瀏覽代碼

Merge branch 'hl'

# Conflicts:
#	CMakeLists.txt
#	lidar_locate/Locate_communicator.cpp
#	lidar_locate/Locate_communicator.h
zx 4 年之前
父節點
當前提交
b94645a004

+ 84 - 0
communication/communication_message.cpp

@@ -3,3 +3,87 @@
 //
 
 #include "communication_message.h"
+
+
+Communication_message::Communication_message()
+{
+	m_message_type = eBase_msg;
+	m_receive_time = std::chrono::system_clock::now();
+	m_timeout_ms = std::chrono::milliseconds(5000);		//超时默认5秒
+	m_sender = eEmpty;
+	m_receiver = eEmpty;
+//	m_message_buf = "";
+}
+
+Communication_message::Communication_message(std::string message_buf)
+{
+	m_message_type = eBase_msg;
+	m_receive_time = std::chrono::system_clock::now();
+	m_timeout_ms = std::chrono::milliseconds(5000);		//超时默认5秒
+	m_sender = eEmpty;
+	m_receiver = eEmpty;
+	m_message_buf = message_buf;
+}
+
+Communication_message::Communication_message(char* p_buf, int size)
+{
+	m_message_type = eBase_msg;
+	m_receive_time = std::chrono::system_clock::now();
+	m_timeout_ms = std::chrono::milliseconds(5000);		//超时默认5秒
+	m_sender = eEmpty;
+	m_receiver = eEmpty;
+	m_message_buf = std::string(p_buf, size);
+}
+
+
+
+Communication_message::~Communication_message()
+{
+
+}
+
+bool Communication_message::is_over_time()
+{
+	if ( std::chrono::system_clock::now() - m_receive_time > m_timeout_ms)
+	{
+	    return true;
+	}
+	else
+	{
+		return false;
+	}
+}
+
+
+void Communication_message::reset(message::Base_msg& base_msg, std::string receive_string)
+{
+	m_message_type = (Message_type)(base_msg.msg_type());
+
+	m_receive_time = std::chrono::system_clock::now();
+	m_timeout_ms = std::chrono::milliseconds(base_msg.timeout_ms());
+	m_sender = (Communicator)(base_msg.sender());
+	m_receiver = (Communicator)(base_msg.receiver());
+	m_message_buf = receive_string;
+}
+
+Communication_message::Message_type Communication_message::get_message_type()
+{
+	return m_message_type;
+}
+Communication_message::Communicator Communication_message::get_sender()
+{
+	return m_sender;
+}
+Communication_message::Communicator Communication_message::get_receiver()
+{
+	return m_receiver;
+}
+std::string& Communication_message::get_message_buf()
+{
+	return m_message_buf;
+}
+
+
+
+
+

+ 41 - 9
communication/communication_message.h

@@ -5,39 +5,71 @@
 #ifndef NNXX_TESTS_COMMUNICATION_MESSAGE_H
 #define NNXX_TESTS_COMMUNICATION_MESSAGE_H
 
+#include "../error_code/error_code.h"
+
 #include <time.h>
 #include <sys/time.h>
 #include <chrono>
+//#include <iosfwd>
+
+#include <string>
+#include "../message/message_base.pb.h"
+
 
 class Communication_message
 {
+public:
 	//消息类型定义,每个在网络上传输的消息必须含有这个属性
 	enum Message_type
 	{
-		COMMAND_MESSAGE				= 0X01,					//指令消息
+		eBase_msg=0x00,
+		eCommand_msg=0x01,                      //指令消息
 
-		SENSING_STATUS_MESSAGE		= 0X11,                	//定位模块状态消息
-		SENSING_REQUEST_MESSAGE		= 0X12,               	//定位请求消息
-		SENSING_RESPONSE_MESSAGE	= 0X13,              	//定位反馈消息
+		eLocate_status_msg=0x11,                //定位模块状态消息
+		eLocate_request_msg=0x12,               //定位请求消息
+		eLocate_response_msg=0x13,              //定位反馈消息
 
-		HARWARE_STATU_MESSAGE		= 0X21,                	//调度模块硬件状态消息
-		EXECUTE_REQUEST_MESSAGE		= 0X22,              	//请求调度消息
-		EXECUTE_RESPONSE_MESSAGE	= 0X23,             	//调度结果反馈消息
+		eHarware_statu_msg=0x21,                //调度模块硬件状态消息
+		eExecute_request_msg=0x22,              //请求调度消息
+		eExecute_response_msg=0x23,             //调度结果反馈消息
 	};
 
+//通讯单元
+	enum Communicator
+	{
+		eEmpty=0x0000,		//空
+		eMain=0x0001,    	//主流程
+		eTerminor=0x0100,	//终端
+		eTable=0x0200,		//数据表
+		eMeasurer=0x0300,	//测量单元
+		eProcess=0x0400,	//调度机构
+		//...
+	};
 public:
 	Communication_message();
+	Communication_message(std::string message_buf);
+	Communication_message(char* p_buf, int size);
 	Communication_message(const Communication_message& other)= default;
 	Communication_message& operator =(const Communication_message& other)= default;
 	~Communication_message();
 public://API functions
-
+	bool is_over_time();
 public://get or set member variable
+	void reset(message::Base_msg& base_msg, std::string receive_string);
 
+	Message_type get_message_type();
+	Communicator get_sender();
+	Communicator get_receiver();
+	std::string& get_message_buf();
 
 protected://member variable
 	Message_type								m_message_type;				//消息类型
-	std::chrono::system_clock::time_point		m_receive_time;				//接收时间
+	std::chrono::system_clock::time_point		m_receive_time;				//接收消息的时间点
+	std::chrono::milliseconds					m_timeout_ms;				//超时时间, 整个软件都统一为毫秒
+	Communicator								m_sender;					//发送者
+	Communicator								m_receiver;					//接受者
+
+	std::string									m_message_buf;				//消息数据
 
 private:
 

+ 155 - 54
communication/communication_socket_base.cpp

@@ -245,22 +245,46 @@ void Communication_socket_base::receive_data_thread()
 
 			std::unique_lock<std::mutex> lk(m_mutex);
 			//flags为1, 非阻塞接受消息, 如果接收到消息, 那么接受数据长度大于0
-			nnxx::message t_msg = m_socket.recv(1);
-			if ( t_msg.size()>0 )
+			std::string t_receive_string = m_socket.recv<std::string>(1);
+			if ( t_receive_string.size()>0 )
 			{
-				Binary_buf * tp_binary_buf = new Binary_buf( (char*)(t_msg.data()), t_msg.size() );
-//				std::cout << tp_binary_buf->get_buf() << std::endl;
-				bool is_push = m_receive_data_list.push(tp_binary_buf);
-//				if ( is_push == false )
-//				{
+				//如果这里接受到了消息, 在这提前解析消息最前面的Base_msg (消息公共内容), 用于后续的check
+				message::Base_msg t_base_msg;
+				if( t_base_msg.ParseFromString(t_receive_string) )
+				{
+					//第一次解析之后转化为, Communication_message, 自定义的通信消息格式
+					Communication_message  * tp_communication_message = new Communication_message;
+					tp_communication_message->reset(t_base_msg, t_receive_string);
+					//检查消息是否有效, 主要检查消息类型和接受者, 判断这条消息是不是给我的.
+					if ( check_msg(tp_communication_message) == SUCCESS )
+					{
+						bool is_push = m_receive_data_list.push(tp_communication_message);
+						//push成功之后, tp_communication_message内存的管理权限交给链表, 如果失败就要回收内存
+						if ( is_push )
+						{
+							//唤醒解析线程一次,
+							m_analysis_data_condition.notify_all(false, true);
+						}
+						else
+						{
+//						push失败, 就要回收内存
+							delete(tp_communication_message);
+							tp_communication_message = NULL;
 //					return Error_manager(Error_code::CONTAINER_IS_TERMINATE, Error_level::MINOR_ERROR,
 //										 " m_receive_data_list.push error ");
-//				}
+						}
+					}
+					else
+					{
+						delete(tp_communication_message);
+						tp_communication_message = NULL;
+					}
 
-				//唤醒解析线程一次,
-				m_analysis_data_condition.notify_all(false, true);
-			}
 
+				}
+				//解析失败, 就当做什么也没发生, 认为接收消息无效,
+			}
+			//没有接受到消息, 返回空字符串
 		}
 	}
 
@@ -268,6 +292,23 @@ void Communication_socket_base::receive_data_thread()
 	return;
 }
 
+//检查消息是否有效, 主要检查消息类型和接受者, 判断这条消息是不是给我的.
+Error_manager Communication_socket_base::check_msg(Communication_message*  p_msg)
+{
+	//通过 p_msg->get_message_type() 和 p_msg->get_receiver() 判断这条消息是不是给我的.
+	//子类重载时, 增加自己模块的判断逻辑, 以后再写.
+	if ( p_msg->get_message_type() == Communication_message::Message_type::eBase_msg
+		 && p_msg->get_receiver() == Communication_message::Communicator::eMain )
+	{
+		return Error_code::SUCCESS;
+	}
+	else
+	{
+		//认为接受人
+		return Error_code::INVALID_MESSAGE;
+	}
+}
+
 //mp_analysis_data_thread 解析线程执行函数,
 //analysis_data_thread 内部线程负责解析消息
 void Communication_socket_base::analysis_data_thread()
@@ -312,20 +353,20 @@ Error_manager Communication_socket_base::analysis_receive_list()
 		std::unique_lock<std::mutex> lk(m_receive_data_list.m_mutex);
 		for (auto iter = m_receive_data_list.m_data_list.begin(); iter != m_receive_data_list.m_data_list.end(); )
 		{
-			Binary_buf* tp_buf = **iter;
-			if ( tp_buf == NULL )
+			Communication_message* tp_msg = **iter;
+			if ( tp_msg == NULL )
 			{
 				iter = m_receive_data_list.m_data_list.erase(iter);
 				//注:erase 删除当前 iter 之后返回下一个节点,当前的 iter 无效化,
 			}
 			else
 			{
-				//检查消息是否可以被解析
-				t_error = check_msg(tp_buf);
+				//检查消息是否可以被处理
+				t_error = check_executer(tp_msg);
 				if ( t_error == SUCCESS)
 				{
 					//处理消息
-					t_error = excute_msg(tp_buf);
+					t_error = execute_msg(tp_msg);
 //				if ( t_error )
 //				{
 //					//执行结果不管
@@ -334,57 +375,90 @@ Error_manager Communication_socket_base::analysis_receive_list()
 //				{
 //					//执行结果不管
 //				}
-					delete(tp_buf);
-					tp_buf = NULL;
-					iter = m_receive_data_list.m_data_list.erase(iter);
-					//注:erase 删除当前 iter 之后返回下一个节点,当前的 iter 无效化,
-				}
-				else if( t_error == COMMUNICATION_ANALYSIS_TIME_OUT )
-				{
-					//超时了就直接删除
-					delete(tp_buf);
-					tp_buf = NULL;
+					delete(tp_msg);
+					tp_msg = NULL;
 					iter = m_receive_data_list.m_data_list.erase(iter);
 					//注:erase 删除当前 iter 之后返回下一个节点,当前的 iter 无效化,
 				}
-				else //if( t_error == COMMUNICATION_EXCUTER_IS_BUSY)
+				else if( t_error == COMMUNICATION_EXCUTER_IS_BUSY)
 				{
 					//处理器正忙, 那就不做处理, 直接处理下一个
 					//注:这条消息就被保留了下来, wait_for_millisecond 超时通过之后, 会循环检查残留的消息.
 					iter++;
 				}
+				else //if( t_error == COMMUNICATION_ANALYSIS_TIME_OUT )
+				{
+					//超时了就直接删除
+					delete(tp_msg);
+					tp_msg = NULL;
+					iter = m_receive_data_list.m_data_list.erase(iter);
+					//注:erase 删除当前 iter 之后返回下一个节点,当前的 iter 无效化,
+
+					//注:消息删除之后, 不需要发送答复消息, 发送方也会有超时处理的,  只有 execute_msg 里面可以答复消息
+				}
 			}
 		}
 	}
 	return Error_code::SUCCESS;
 }
 
-//检查消息是否可以被解析
-Error_manager Communication_socket_base::check_msg(Binary_buf* p_buf)
+
+
+//检查执行者的状态, 判断能否处理这条消息, 需要子类重载
+Error_manager Communication_socket_base::check_executer(Communication_message*  p_msg)
 {
 	//检查对应模块的状态, 判断是否可以处理这条消息
 	//同时也要判断是否超时, 超时返回 COMMUNICATION_ANALYSIS_TIME_OUT
 	//如果处理器正在忙别的, 那么返回 COMMUNICATION_EXCUTER_IS_BUSY
 
-	//......................
+	if ( p_msg->is_over_time() )
+	{
+		std::cout << "Communication_socket_base::check_msg  p_buf =  " << p_msg->get_message_buf() << std::endl;
+		std::cout << "Communication_socket_base::check_msg   size =  " << p_msg->get_message_buf().size() << std::endl;
+		std::cout << "COMMUNICATION_ANALYSIS_TIME_OUT , " << std::endl;
+		return Error_code::COMMUNICATION_ANALYSIS_TIME_OUT;
+	}
+	else
+	{
+		bool executer_is_ready = false;
+		//通过 p_msg->get_message_type() 和 p_msg->get_receiver() 找到处理模块的实例对象, 查询执行人是否可以处理这条消息
+		//这里子类重载时, 增加判断逻辑, 以后再写.
+//		executer_is_ready = true;
+
+		std::cout << "Communication_socket_base::check_msg  p_buf =  " << p_msg->get_message_buf() << std::endl;
+		std::cout << "Communication_socket_base::check_msg   size =  " << p_msg->get_message_buf().size() << std::endl;
 
-	std::cout << "Communication_socket_base::check_msg  p_buf =  " << p_buf->get_buf() << std::endl;
-	std::cout << "Communication_socket_base::check_msg   size =  " << p_buf->get_length() << std::endl;
+		if ( executer_is_ready )
+		{
+			std::cout << "executer_is_ready , " << std::endl;
+			return Error_code::SUCCESS;
+		}
+		else
+		{
+			std::cout << "executer_is_busy , " << std::endl;
+			return Error_code::COMMUNICATION_EXCUTER_IS_BUSY;
+		}
+	}
 
-//	return Error_code::COMMUNICATION_ANALYSIS_TIME_OUT;
-//	return Error_code::COMMUNICATION_EXCUTER_IS_BUSY;
 	return Error_code::SUCCESS;
 }
 
 //处理消息
-Error_manager Communication_socket_base::excute_msg(Binary_buf* p_buf)
+Error_manager Communication_socket_base::execute_msg(Communication_message*  p_msg)
 {
-	//先将 p_buf 转化为 对应的格式, 不能一直使用 p_buf, 和这个是要销毁的
-	//然后处理这个消息, 就是调用对应模块的 excute 接口函数
+	//先将 p_msg 转化为 对应的格式, 使用对应模块的protobuf来二次解析
+	// 不能一直使用 Communication_message*  p_msg, 这个是要销毁的
+	//然后处理这个消息, 就是调用对应模块的 execute 接口函数
 	//执行结果不管, 如果需要答复, 那么对应模块 在自己内部 封装一条消息发送即可.
+	//子类重载, 需要完全重写, 以后再写.
 
-	std::cout << "Communication_socket_base::excute_msg  p_buf =  " << p_buf->get_buf() << std::endl;
-	std::cout << "Communication_socket_base::excute_msg   size =  " << p_buf->get_length() << std::endl;
+	//注注注注注意了, 本模块只是用来做通信,
+	//在做处理消息的时候, 可能会调用执行者的接口函数,
+	//这里不应该长时间阻塞或者处理复杂的逻辑,
+	//请执行者另开线程来处理任务.
+
+	std::cout << "Communication_socket_base::excute_msg  p_buf =  " << p_msg->get_message_buf() << std::endl;
+	std::cout << "Communication_socket_base::excute_msg   size =  " << p_msg->get_message_buf().size() << std::endl;
 	return Error_code::SUCCESS;
 }
 
@@ -402,19 +476,19 @@ void Communication_socket_base::send_data_thread()
 		{
 			std::this_thread::yield();
 
-			Binary_buf* tp_buf = NULL;
+			Communication_message* tp_msg = NULL;
 			//这里 wait_and_pop 会使用链表内部的 m_data_cond 条件变量来控制等待,
 			//封装线程使用push的时候, 会唤醒线程并通过等待, 此时 m_send_data_condition 是一直通过的.
 			//如果需要退出, 那么就要 m_send_data_list.termination_list();	和 m_send_data_condition.kill_all();
-			bool is_pop = m_send_data_list.wait_and_pop(tp_buf);
+			bool is_pop = m_send_data_list.wait_and_pop(tp_msg);
 			if ( is_pop )
 			{
-				if ( tp_buf != NULL )
+				if ( tp_msg != NULL )
 				{
 					std::unique_lock<std::mutex> lk(m_mutex);
-					m_socket.send(tp_buf->get_buf(), tp_buf->get_length(), 0);
-					delete(tp_buf);
-					tp_buf = NULL;
+					int send_size = m_socket.send(tp_msg->get_message_buf());
+					delete(tp_msg);
+					tp_msg = NULL;
 				}
 			}
 			else
@@ -464,15 +538,40 @@ void Communication_socket_base::encapsulate_data_thread()
 //定时封装发送消息, 一般为心跳和状态信息, 需要子类重载
 Error_manager Communication_socket_base::encapsulate_send_data()
 {
-	char buf[256] = {0};
-	static unsigned int t_heartbeat = 0;
-	sprintf(buf, "Communication_socket_base, heartbeat = %d\0\0\0", t_heartbeat);
-	t_heartbeat++;
+//	char buf[256] = {0};
+//	static unsigned int t_heartbeat = 0;
+//	sprintf(buf, "Communication_socket_base, heartbeat = %d\0\0\0, test\0", t_heartbeat);
+//	t_heartbeat++;
+
+	message::Base_msg t_base_msg;
+	t_base_msg.set_msg_type(message::Message_type::eBase_msg);
+	t_base_msg.set_timeout_ms(5000);
+	t_base_msg.set_sender(message::Communicator::eMain);
+	t_base_msg.set_receiver(message::Communicator::eMain);
+
+	Communication_message* tp_msg = new Communication_message(t_base_msg.SerializeAsString());
+	bool is_push = m_send_data_list.push(tp_msg);
+	if ( is_push == false )
+	{
+		delete(tp_msg);
+		tp_msg = NULL;
+		return Error_manager(Error_code::CONTAINER_IS_TERMINATE, Error_level::MINOR_ERROR,
+							 " Communication_socket_base::encapsulate_msg error ");
+	}
+	return Error_code::SUCCESS;
+}
+
 
-	Binary_buf* tp_buf = new Binary_buf(buf, strlen(buf)+1);//+1是为了保证发送了结束符, 方便打印
-	bool is_push = m_send_data_list.push(tp_buf);
+
+//封装消息, 需要子类重载
+Error_manager Communication_socket_base::encapsulate_msg(std::string message)
+{
+	Communication_message* tp_msg = new Communication_message(message);
+	bool is_push = m_send_data_list.push(tp_msg);
 	if ( is_push == false )
 	{
+		delete(tp_msg);
+		tp_msg = NULL;
 		return Error_manager(Error_code::CONTAINER_IS_TERMINATE, Error_level::MINOR_ERROR,
 							 " Communication_socket_base::encapsulate_msg error ");
 	}
@@ -480,12 +579,14 @@ Error_manager Communication_socket_base::encapsulate_send_data()
 }
 
 //封装消息, 需要子类重载
-Error_manager Communication_socket_base::encapsulate_msg(Binary_buf* p_buf)
+Error_manager Communication_socket_base::encapsulate_msg(Communication_message* p_msg)
 {
-	Binary_buf * tp_buf = new Binary_buf(*p_buf);
-	bool is_push = m_send_data_list.push(p_buf);
+	Communication_message* tp_msg = new Communication_message(*p_msg);
+	bool is_push = m_send_data_list.push(tp_msg);
 	if ( is_push == false )
 	{
+		delete(tp_msg);
+		tp_msg = NULL;
 		return Error_manager(Error_code::CONTAINER_IS_TERMINATE, Error_level::MINOR_ERROR,
 							 " Communication_socket_base::encapsulate_msg error ");
 	}

+ 17 - 5
communication/communication_socket_base.h

@@ -24,7 +24,14 @@
 #include "../tool/binary_buf.h"
 #include "../tool/thread_safe_list.h"
 #include "../tool/thread_condition.h"
+
 #include "../communication/communication.pb.h"
+#include "../communication/communication_message.h"
+
+#include "../message/message_base.pb.h"
+#include "../message/measure_message.pb.h"
+
+
 
 #define COMMUNICATION_PARAMETER_PATH "../setting/communication.prototxt"
 
@@ -74,6 +81,9 @@ protected:
 	//receive_data_thread 内部线程负责接受消息
 	void receive_data_thread();
 
+	//检查消息是否可以被解析, 需要子类重载
+	virtual Error_manager check_msg(Communication_message* p_msg);
+
 	//mp_analysis_data_thread 解析线程执行函数,
 	//analysis_data_thread 内部线程负责解析消息
 	void analysis_data_thread();
@@ -82,10 +92,10 @@ protected:
 	Error_manager analysis_receive_list();
 
 	//检查消息是否可以被解析, 需要子类重载
-	virtual Error_manager check_msg(Binary_buf* p_buf);
+	virtual Error_manager check_executer(Communication_message* p_msg);
 
 	//处理消息, 需要子类重载
-	virtual Error_manager excute_msg(Binary_buf* p_buf);
+	virtual Error_manager execute_msg(Communication_message* p_msg);
 
 	//mp_send_data_thread 发送线程执行函数,
 	//send_data_thread 内部线程负责发送消息
@@ -100,7 +110,9 @@ protected:
 
 public:
 	//封装消息, 需要子类重载
-	virtual Error_manager encapsulate_msg(Binary_buf* p_buf);
+	virtual Error_manager encapsulate_msg(std::string message);
+	//封装消息, 需要子类重载
+	virtual Error_manager encapsulate_msg(Communication_message* p_msg);
 
 protected://member variable
 
@@ -112,7 +124,7 @@ protected://member variable
 	Communication_statu 				m_communication_statu;			//通信状态
 
 	//接受模块,
-	Thread_safe_list<Binary_buf*>		m_receive_data_list; 			//接受的list容器
+	Thread_safe_list<Communication_message*>		m_receive_data_list; 			//接受的list容器
 	std::thread*						mp_receive_data_thread;    		//接受的线程指针
 	Thread_condition					m_receive_condition;			//接受的条件变量
 	std::thread*						mp_analysis_data_thread;    	//解析的线程指针
@@ -120,7 +132,7 @@ protected://member variable
 
 
 	//发送模块,
-	Thread_safe_list<Binary_buf*>		m_send_data_list;				//发送的list容器
+	Thread_safe_list<Communication_message*>		m_send_data_list;				//发送的list容器
 	std::thread*						mp_send_data_thread;    		//发送的线程指针
 	Thread_condition					m_send_data_condition;			//发送的条件变量
 	std::thread*						mp_encapsulate_data_thread;    	//封装的线程指针

+ 3 - 1
error_code/error_code.h

@@ -54,7 +54,7 @@ enum Error_code
     FAILED                          = 0x00000004,//失败
 
     NO_DATA                         = 0x00000010,//没有数据,传入参数容器内部没有数据时,
-
+	INVALID_MESSAGE					= 0x00000011, //无效的消息,
 
     POINTER_IS_NULL                 = 0x00000101,//空指针
     PARAMETER_ERROR                 = 0x00000102,//参数错误,传入参数不符合规范时,
@@ -65,6 +65,8 @@ enum Error_code
 	CONTAINER_IS_TERMINATE			= 0x00000301,//容器被终止
 
 
+
+
 //    错误码的规范,
 //    错误码是int型,32位,十六进制。
 //    例如0x12345678

+ 9 - 49
main.cpp

@@ -4,60 +4,20 @@
 
 #include <iostream>
 #include <glog/logging.h>
-#include "setting.pb.h"
-#include "lidar_locate/Locate_communicator.h"
 
-#include <fcntl.h>
-#include <google/protobuf/io/zero_copy_stream_impl.h>
-#include <google/protobuf/text_format.h>
-using google::protobuf::io::FileInputStream;
-using google::protobuf::io::FileOutputStream;
-using google::protobuf::io::ZeroCopyInputStream;
-using google::protobuf::io::CodedInputStream;
-using google::protobuf::io::ZeroCopyOutputStream;
-using google::protobuf::io::CodedOutputStream;
-using google::protobuf::Message;
-
-bool read_proto_param(std::string file, ::google::protobuf::Message& parameter)
-{
-    int fd = open(file.c_str(), O_RDONLY);
-    if (fd == -1) return false;
-    FileInputStream* input = new FileInputStream(fd);
-
-    bool success = google::protobuf::TextFormat::Parse(input, &parameter);
-    delete input;
-    close(fd);
-    return success;
-}
+#include "./communication/communication_socket_base.h"
 
 int main(int argc,char* argv[])
 {
-    //读取配置
-    ///
-    setting::global_setting parameter;
+	Communication_socket_base csb;
 
-    if(false==read_proto_param("",parameter))
-    {
-        LOG(ERROR)<<"read setting file failed";
-        return 0;
-    }
+//	std::vector<std::string> connect_string_vector;
+//	connect_string_vector.push_back("tcp://192.168.2.166:9001");
+//	csb.communication_init("tcp://192.168.2.166:9000", connect_string_vector);
 
-    //创建各个模块的通讯对象
-    setting::locate_setting locate_parameter=parameter.locate_parameter();
-    Error_manager code=Locate_communicator::create_locate_communicator(locate_parameter.ip(),locate_parameter.port());
-    if(code!=SUCCESS)
-    {
-        LOG(ERROR)<<code.to_string();
-    }
-    //测试各个模块
-//    message::Command_message cmd_msg;
-    message::Locate_request_msg request;
-    message::Locate_response_msg result;
+	csb.communication_init();
 
-    code=Locate_communicator::get_instance()->locate_request(request,result);
-    if(code!=SUCCESS)
-    {
-        LOG(ERROR)<<code.to_string();
-    }
-    return 0;
+	char ch ;
+	std::cin >> ch ;
+	return 0;
 }

文件差異過大導致無法顯示
+ 254 - 254
message/measure_message.pb.cc


+ 221 - 221
message/measure_message.pb.h

@@ -44,28 +44,28 @@ struct TableStruct {
   static const ::google::protobuf::uint32 offsets[];
 };
 void AddDescriptors();
-void InitDefaultsLocate_status_msgImpl();
-void InitDefaultsLocate_status_msg();
-void InitDefaultsLocate_request_msgImpl();
-void InitDefaultsLocate_request_msg();
-void InitDefaultsLocate_response_msgImpl();
-void InitDefaultsLocate_response_msg();
+void InitDefaultsMeasure_status_msgImpl();
+void InitDefaultsMeasure_status_msg();
+void InitDefaultsMeasure_request_msgImpl();
+void InitDefaultsMeasure_request_msg();
+void InitDefaultsMeasure_response_msgImpl();
+void InitDefaultsMeasure_response_msg();
 inline void InitDefaults() {
-  InitDefaultsLocate_status_msg();
-  InitDefaultsLocate_request_msg();
-  InitDefaultsLocate_response_msg();
+  InitDefaultsMeasure_status_msg();
+  InitDefaultsMeasure_request_msg();
+  InitDefaultsMeasure_response_msg();
 }
 }  // namespace protobuf_measure_5fmessage_2eproto
 namespace message {
-class Locate_request_msg;
-class Locate_request_msgDefaultTypeInternal;
-extern Locate_request_msgDefaultTypeInternal _Locate_request_msg_default_instance_;
-class Locate_response_msg;
-class Locate_response_msgDefaultTypeInternal;
-extern Locate_response_msgDefaultTypeInternal _Locate_response_msg_default_instance_;
-class Locate_status_msg;
-class Locate_status_msgDefaultTypeInternal;
-extern Locate_status_msgDefaultTypeInternal _Locate_status_msg_default_instance_;
+class Measure_request_msg;
+class Measure_request_msgDefaultTypeInternal;
+extern Measure_request_msgDefaultTypeInternal _Measure_request_msg_default_instance_;
+class Measure_response_msg;
+class Measure_response_msgDefaultTypeInternal;
+extern Measure_response_msgDefaultTypeInternal _Measure_response_msg_default_instance_;
+class Measure_status_msg;
+class Measure_status_msgDefaultTypeInternal;
+extern Measure_status_msgDefaultTypeInternal _Measure_status_msg_default_instance_;
 }  // namespace message
 namespace message {
 
@@ -137,24 +137,24 @@ inline bool Locate_manager_status_Parse(
 }
 // ===================================================================
 
-class Locate_status_msg : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:message.Locate_status_msg) */ {
+class Measure_status_msg : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:message.Measure_status_msg) */ {
  public:
-  Locate_status_msg();
-  virtual ~Locate_status_msg();
+  Measure_status_msg();
+  virtual ~Measure_status_msg();
 
-  Locate_status_msg(const Locate_status_msg& from);
+  Measure_status_msg(const Measure_status_msg& from);
 
-  inline Locate_status_msg& operator=(const Locate_status_msg& from) {
+  inline Measure_status_msg& operator=(const Measure_status_msg& from) {
     CopyFrom(from);
     return *this;
   }
   #if LANG_CXX11
-  Locate_status_msg(Locate_status_msg&& from) noexcept
-    : Locate_status_msg() {
+  Measure_status_msg(Measure_status_msg&& from) noexcept
+    : Measure_status_msg() {
     *this = ::std::move(from);
   }
 
-  inline Locate_status_msg& operator=(Locate_status_msg&& from) noexcept {
+  inline Measure_status_msg& operator=(Measure_status_msg&& from) noexcept {
     if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
       if (this != &from) InternalSwap(&from);
     } else {
@@ -171,30 +171,30 @@ class Locate_status_msg : public ::google::protobuf::Message /* @@protoc_inserti
   }
 
   static const ::google::protobuf::Descriptor* descriptor();
-  static const Locate_status_msg& default_instance();
+  static const Measure_status_msg& default_instance();
 
   static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
-  static inline const Locate_status_msg* internal_default_instance() {
-    return reinterpret_cast<const Locate_status_msg*>(
-               &_Locate_status_msg_default_instance_);
+  static inline const Measure_status_msg* internal_default_instance() {
+    return reinterpret_cast<const Measure_status_msg*>(
+               &_Measure_status_msg_default_instance_);
   }
   static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
     0;
 
-  void Swap(Locate_status_msg* other);
-  friend void swap(Locate_status_msg& a, Locate_status_msg& b) {
+  void Swap(Measure_status_msg* other);
+  friend void swap(Measure_status_msg& a, Measure_status_msg& b) {
     a.Swap(&b);
   }
 
   // implements Message ----------------------------------------------
 
-  inline Locate_status_msg* New() const PROTOBUF_FINAL { return New(NULL); }
+  inline Measure_status_msg* New() const PROTOBUF_FINAL { return New(NULL); }
 
-  Locate_status_msg* New(::google::protobuf::Arena* arena) const PROTOBUF_FINAL;
+  Measure_status_msg* 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 Locate_status_msg& from);
-  void MergeFrom(const Locate_status_msg& from);
+  void CopyFrom(const Measure_status_msg& from);
+  void MergeFrom(const Measure_status_msg& from);
   void Clear() PROTOBUF_FINAL;
   bool IsInitialized() const PROTOBUF_FINAL;
 
@@ -210,7 +210,7 @@ class Locate_status_msg : public ::google::protobuf::Message /* @@protoc_inserti
   void SharedCtor();
   void SharedDtor();
   void SetCachedSize(int size) const PROTOBUF_FINAL;
-  void InternalSwap(Locate_status_msg* other);
+  void InternalSwap(Measure_status_msg* other);
   private:
   inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
     return NULL;
@@ -277,7 +277,7 @@ class Locate_status_msg : public ::google::protobuf::Message /* @@protoc_inserti
   ::message::Locate_manager_status locate_manager_status() const;
   void set_locate_manager_status(::message::Locate_manager_status value);
 
-  // @@protoc_insertion_point(class_scope:message.Locate_status_msg)
+  // @@protoc_insertion_point(class_scope:message.Measure_status_msg)
  private:
   void set_has_msg_type();
   void clear_has_msg_type();
@@ -303,28 +303,28 @@ class Locate_status_msg : public ::google::protobuf::Message /* @@protoc_inserti
   int laser_manager_status_;
   int locate_manager_status_;
   friend struct ::protobuf_measure_5fmessage_2eproto::TableStruct;
-  friend void ::protobuf_measure_5fmessage_2eproto::InitDefaultsLocate_status_msgImpl();
+  friend void ::protobuf_measure_5fmessage_2eproto::InitDefaultsMeasure_status_msgImpl();
 };
 // -------------------------------------------------------------------
 
-class Locate_request_msg : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:message.Locate_request_msg) */ {
+class Measure_request_msg : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:message.Measure_request_msg) */ {
  public:
-  Locate_request_msg();
-  virtual ~Locate_request_msg();
+  Measure_request_msg();
+  virtual ~Measure_request_msg();
 
-  Locate_request_msg(const Locate_request_msg& from);
+  Measure_request_msg(const Measure_request_msg& from);
 
-  inline Locate_request_msg& operator=(const Locate_request_msg& from) {
+  inline Measure_request_msg& operator=(const Measure_request_msg& from) {
     CopyFrom(from);
     return *this;
   }
   #if LANG_CXX11
-  Locate_request_msg(Locate_request_msg&& from) noexcept
-    : Locate_request_msg() {
+  Measure_request_msg(Measure_request_msg&& from) noexcept
+    : Measure_request_msg() {
     *this = ::std::move(from);
   }
 
-  inline Locate_request_msg& operator=(Locate_request_msg&& from) noexcept {
+  inline Measure_request_msg& operator=(Measure_request_msg&& from) noexcept {
     if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
       if (this != &from) InternalSwap(&from);
     } else {
@@ -341,30 +341,30 @@ class Locate_request_msg : public ::google::protobuf::Message /* @@protoc_insert
   }
 
   static const ::google::protobuf::Descriptor* descriptor();
-  static const Locate_request_msg& default_instance();
+  static const Measure_request_msg& default_instance();
 
   static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
-  static inline const Locate_request_msg* internal_default_instance() {
-    return reinterpret_cast<const Locate_request_msg*>(
-               &_Locate_request_msg_default_instance_);
+  static inline const Measure_request_msg* internal_default_instance() {
+    return reinterpret_cast<const Measure_request_msg*>(
+               &_Measure_request_msg_default_instance_);
   }
   static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
     1;
 
-  void Swap(Locate_request_msg* other);
-  friend void swap(Locate_request_msg& a, Locate_request_msg& b) {
+  void Swap(Measure_request_msg* other);
+  friend void swap(Measure_request_msg& a, Measure_request_msg& b) {
     a.Swap(&b);
   }
 
   // implements Message ----------------------------------------------
 
-  inline Locate_request_msg* New() const PROTOBUF_FINAL { return New(NULL); }
+  inline Measure_request_msg* New() const PROTOBUF_FINAL { return New(NULL); }
 
-  Locate_request_msg* New(::google::protobuf::Arena* arena) const PROTOBUF_FINAL;
+  Measure_request_msg* 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 Locate_request_msg& from);
-  void MergeFrom(const Locate_request_msg& from);
+  void CopyFrom(const Measure_request_msg& from);
+  void MergeFrom(const Measure_request_msg& from);
   void Clear() PROTOBUF_FINAL;
   bool IsInitialized() const PROTOBUF_FINAL;
 
@@ -380,7 +380,7 @@ class Locate_request_msg : public ::google::protobuf::Message /* @@protoc_insert
   void SharedCtor();
   void SharedDtor();
   void SetCachedSize(int size) const PROTOBUF_FINAL;
-  void InternalSwap(Locate_request_msg* other);
+  void InternalSwap(Measure_request_msg* other);
   private:
   inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
     return NULL;
@@ -419,7 +419,7 @@ class Locate_request_msg : public ::google::protobuf::Message /* @@protoc_insert
   ::google::protobuf::int32 terminal_id() const;
   void set_terminal_id(::google::protobuf::int32 value);
 
-  // @@protoc_insertion_point(class_scope:message.Locate_request_msg)
+  // @@protoc_insertion_point(class_scope:message.Measure_request_msg)
  private:
   void set_has_msg_base();
   void clear_has_msg_base();
@@ -438,28 +438,28 @@ class Locate_request_msg : public ::google::protobuf::Message /* @@protoc_insert
   ::google::protobuf::int32 command_id_;
   ::google::protobuf::int32 terminal_id_;
   friend struct ::protobuf_measure_5fmessage_2eproto::TableStruct;
-  friend void ::protobuf_measure_5fmessage_2eproto::InitDefaultsLocate_request_msgImpl();
+  friend void ::protobuf_measure_5fmessage_2eproto::InitDefaultsMeasure_request_msgImpl();
 };
 // -------------------------------------------------------------------
 
-class Locate_response_msg : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:message.Locate_response_msg) */ {
+class Measure_response_msg : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:message.Measure_response_msg) */ {
  public:
-  Locate_response_msg();
-  virtual ~Locate_response_msg();
+  Measure_response_msg();
+  virtual ~Measure_response_msg();
 
-  Locate_response_msg(const Locate_response_msg& from);
+  Measure_response_msg(const Measure_response_msg& from);
 
-  inline Locate_response_msg& operator=(const Locate_response_msg& from) {
+  inline Measure_response_msg& operator=(const Measure_response_msg& from) {
     CopyFrom(from);
     return *this;
   }
   #if LANG_CXX11
-  Locate_response_msg(Locate_response_msg&& from) noexcept
-    : Locate_response_msg() {
+  Measure_response_msg(Measure_response_msg&& from) noexcept
+    : Measure_response_msg() {
     *this = ::std::move(from);
   }
 
-  inline Locate_response_msg& operator=(Locate_response_msg&& from) noexcept {
+  inline Measure_response_msg& operator=(Measure_response_msg&& from) noexcept {
     if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
       if (this != &from) InternalSwap(&from);
     } else {
@@ -476,30 +476,30 @@ class Locate_response_msg : public ::google::protobuf::Message /* @@protoc_inser
   }
 
   static const ::google::protobuf::Descriptor* descriptor();
-  static const Locate_response_msg& default_instance();
+  static const Measure_response_msg& default_instance();
 
   static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
-  static inline const Locate_response_msg* internal_default_instance() {
-    return reinterpret_cast<const Locate_response_msg*>(
-               &_Locate_response_msg_default_instance_);
+  static inline const Measure_response_msg* internal_default_instance() {
+    return reinterpret_cast<const Measure_response_msg*>(
+               &_Measure_response_msg_default_instance_);
   }
   static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
     2;
 
-  void Swap(Locate_response_msg* other);
-  friend void swap(Locate_response_msg& a, Locate_response_msg& b) {
+  void Swap(Measure_response_msg* other);
+  friend void swap(Measure_response_msg& a, Measure_response_msg& b) {
     a.Swap(&b);
   }
 
   // implements Message ----------------------------------------------
 
-  inline Locate_response_msg* New() const PROTOBUF_FINAL { return New(NULL); }
+  inline Measure_response_msg* New() const PROTOBUF_FINAL { return New(NULL); }
 
-  Locate_response_msg* New(::google::protobuf::Arena* arena) const PROTOBUF_FINAL;
+  Measure_response_msg* 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 Locate_response_msg& from);
-  void MergeFrom(const Locate_response_msg& from);
+  void CopyFrom(const Measure_response_msg& from);
+  void MergeFrom(const Measure_response_msg& from);
   void Clear() PROTOBUF_FINAL;
   bool IsInitialized() const PROTOBUF_FINAL;
 
@@ -515,7 +515,7 @@ class Locate_response_msg : public ::google::protobuf::Message /* @@protoc_inser
   void SharedCtor();
   void SharedDtor();
   void SetCachedSize(int size) const PROTOBUF_FINAL;
-  void InternalSwap(Locate_response_msg* other);
+  void InternalSwap(Measure_response_msg* other);
   private:
   inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
     return NULL;
@@ -572,7 +572,7 @@ class Locate_response_msg : public ::google::protobuf::Message /* @@protoc_inser
   ::google::protobuf::int32 terminal_id() const;
   void set_terminal_id(::google::protobuf::int32 value);
 
-  // @@protoc_insertion_point(class_scope:message.Locate_response_msg)
+  // @@protoc_insertion_point(class_scope:message.Measure_response_msg)
  private:
   void set_has_msg_base();
   void clear_has_msg_base();
@@ -597,7 +597,7 @@ class Locate_response_msg : public ::google::protobuf::Message /* @@protoc_inser
   ::google::protobuf::int32 command_id_;
   ::google::protobuf::int32 terminal_id_;
   friend struct ::protobuf_measure_5fmessage_2eproto::TableStruct;
-  friend void ::protobuf_measure_5fmessage_2eproto::InitDefaultsLocate_response_msgImpl();
+  friend void ::protobuf_measure_5fmessage_2eproto::InitDefaultsMeasure_response_msgImpl();
 };
 // ===================================================================
 
@@ -608,40 +608,40 @@ class Locate_response_msg : public ::google::protobuf::Message /* @@protoc_inser
   #pragma GCC diagnostic push
   #pragma GCC diagnostic ignored "-Wstrict-aliasing"
 #endif  // __GNUC__
-// Locate_status_msg
+// Measure_status_msg
 
 // required .message.Base_msg msg_type = 1;
-inline bool Locate_status_msg::has_msg_type() const {
+inline bool Measure_status_msg::has_msg_type() const {
   return (_has_bits_[0] & 0x00000001u) != 0;
 }
-inline void Locate_status_msg::set_has_msg_type() {
+inline void Measure_status_msg::set_has_msg_type() {
   _has_bits_[0] |= 0x00000001u;
 }
-inline void Locate_status_msg::clear_has_msg_type() {
+inline void Measure_status_msg::clear_has_msg_type() {
   _has_bits_[0] &= ~0x00000001u;
 }
-inline const ::message::Base_msg& Locate_status_msg::msg_type() const {
+inline const ::message::Base_msg& Measure_status_msg::msg_type() const {
   const ::message::Base_msg* p = msg_type_;
-  // @@protoc_insertion_point(field_get:message.Locate_status_msg.msg_type)
+  // @@protoc_insertion_point(field_get:message.Measure_status_msg.msg_type)
   return p != NULL ? *p : *reinterpret_cast<const ::message::Base_msg*>(
       &::message::_Base_msg_default_instance_);
 }
-inline ::message::Base_msg* Locate_status_msg::release_msg_type() {
-  // @@protoc_insertion_point(field_release:message.Locate_status_msg.msg_type)
+inline ::message::Base_msg* Measure_status_msg::release_msg_type() {
+  // @@protoc_insertion_point(field_release:message.Measure_status_msg.msg_type)
   clear_has_msg_type();
   ::message::Base_msg* temp = msg_type_;
   msg_type_ = NULL;
   return temp;
 }
-inline ::message::Base_msg* Locate_status_msg::mutable_msg_type() {
+inline ::message::Base_msg* Measure_status_msg::mutable_msg_type() {
   set_has_msg_type();
   if (msg_type_ == NULL) {
     msg_type_ = new ::message::Base_msg;
   }
-  // @@protoc_insertion_point(field_mutable:message.Locate_status_msg.msg_type)
+  // @@protoc_insertion_point(field_mutable:message.Measure_status_msg.msg_type)
   return msg_type_;
 }
-inline void Locate_status_msg::set_allocated_msg_type(::message::Base_msg* msg_type) {
+inline void Measure_status_msg::set_allocated_msg_type(::message::Base_msg* msg_type) {
   ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
   if (message_arena == NULL) {
     delete reinterpret_cast< ::google::protobuf::MessageLite*>(msg_type_);
@@ -657,123 +657,123 @@ inline void Locate_status_msg::set_allocated_msg_type(::message::Base_msg* msg_t
     clear_has_msg_type();
   }
   msg_type_ = msg_type;
-  // @@protoc_insertion_point(field_set_allocated:message.Locate_status_msg.msg_type)
+  // @@protoc_insertion_point(field_set_allocated:message.Measure_status_msg.msg_type)
 }
 
 // required .message.Laser_manager_status laser_manager_status = 2;
-inline bool Locate_status_msg::has_laser_manager_status() const {
+inline bool Measure_status_msg::has_laser_manager_status() const {
   return (_has_bits_[0] & 0x00000008u) != 0;
 }
-inline void Locate_status_msg::set_has_laser_manager_status() {
+inline void Measure_status_msg::set_has_laser_manager_status() {
   _has_bits_[0] |= 0x00000008u;
 }
-inline void Locate_status_msg::clear_has_laser_manager_status() {
+inline void Measure_status_msg::clear_has_laser_manager_status() {
   _has_bits_[0] &= ~0x00000008u;
 }
-inline void Locate_status_msg::clear_laser_manager_status() {
+inline void Measure_status_msg::clear_laser_manager_status() {
   laser_manager_status_ = 0;
   clear_has_laser_manager_status();
 }
-inline ::message::Laser_manager_status Locate_status_msg::laser_manager_status() const {
-  // @@protoc_insertion_point(field_get:message.Locate_status_msg.laser_manager_status)
+inline ::message::Laser_manager_status Measure_status_msg::laser_manager_status() const {
+  // @@protoc_insertion_point(field_get:message.Measure_status_msg.laser_manager_status)
   return static_cast< ::message::Laser_manager_status >(laser_manager_status_);
 }
-inline void Locate_status_msg::set_laser_manager_status(::message::Laser_manager_status value) {
+inline void Measure_status_msg::set_laser_manager_status(::message::Laser_manager_status value) {
   assert(::message::Laser_manager_status_IsValid(value));
   set_has_laser_manager_status();
   laser_manager_status_ = value;
-  // @@protoc_insertion_point(field_set:message.Locate_status_msg.laser_manager_status)
+  // @@protoc_insertion_point(field_set:message.Measure_status_msg.laser_manager_status)
 }
 
 // repeated .message.Laser_statu laser_statu_vector = 3;
-inline int Locate_status_msg::laser_statu_vector_size() const {
+inline int Measure_status_msg::laser_statu_vector_size() const {
   return laser_statu_vector_.size();
 }
-inline void Locate_status_msg::clear_laser_statu_vector() {
+inline void Measure_status_msg::clear_laser_statu_vector() {
   laser_statu_vector_.Clear();
 }
-inline ::message::Laser_statu Locate_status_msg::laser_statu_vector(int index) const {
-  // @@protoc_insertion_point(field_get:message.Locate_status_msg.laser_statu_vector)
+inline ::message::Laser_statu Measure_status_msg::laser_statu_vector(int index) const {
+  // @@protoc_insertion_point(field_get:message.Measure_status_msg.laser_statu_vector)
   return static_cast< ::message::Laser_statu >(laser_statu_vector_.Get(index));
 }
-inline void Locate_status_msg::set_laser_statu_vector(int index, ::message::Laser_statu value) {
+inline void Measure_status_msg::set_laser_statu_vector(int index, ::message::Laser_statu value) {
   assert(::message::Laser_statu_IsValid(value));
   laser_statu_vector_.Set(index, value);
-  // @@protoc_insertion_point(field_set:message.Locate_status_msg.laser_statu_vector)
+  // @@protoc_insertion_point(field_set:message.Measure_status_msg.laser_statu_vector)
 }
-inline void Locate_status_msg::add_laser_statu_vector(::message::Laser_statu value) {
+inline void Measure_status_msg::add_laser_statu_vector(::message::Laser_statu value) {
   assert(::message::Laser_statu_IsValid(value));
   laser_statu_vector_.Add(value);
-  // @@protoc_insertion_point(field_add:message.Locate_status_msg.laser_statu_vector)
+  // @@protoc_insertion_point(field_add:message.Measure_status_msg.laser_statu_vector)
 }
 inline const ::google::protobuf::RepeatedField<int>&
-Locate_status_msg::laser_statu_vector() const {
-  // @@protoc_insertion_point(field_list:message.Locate_status_msg.laser_statu_vector)
+Measure_status_msg::laser_statu_vector() const {
+  // @@protoc_insertion_point(field_list:message.Measure_status_msg.laser_statu_vector)
   return laser_statu_vector_;
 }
 inline ::google::protobuf::RepeatedField<int>*
-Locate_status_msg::mutable_laser_statu_vector() {
-  // @@protoc_insertion_point(field_mutable_list:message.Locate_status_msg.laser_statu_vector)
+Measure_status_msg::mutable_laser_statu_vector() {
+  // @@protoc_insertion_point(field_mutable_list:message.Measure_status_msg.laser_statu_vector)
   return &laser_statu_vector_;
 }
 
 // required .message.Locate_manager_status locate_manager_status = 4;
-inline bool Locate_status_msg::has_locate_manager_status() const {
+inline bool Measure_status_msg::has_locate_manager_status() const {
   return (_has_bits_[0] & 0x00000010u) != 0;
 }
-inline void Locate_status_msg::set_has_locate_manager_status() {
+inline void Measure_status_msg::set_has_locate_manager_status() {
   _has_bits_[0] |= 0x00000010u;
 }
-inline void Locate_status_msg::clear_has_locate_manager_status() {
+inline void Measure_status_msg::clear_has_locate_manager_status() {
   _has_bits_[0] &= ~0x00000010u;
 }
-inline void Locate_status_msg::clear_locate_manager_status() {
+inline void Measure_status_msg::clear_locate_manager_status() {
   locate_manager_status_ = 0;
   clear_has_locate_manager_status();
 }
-inline ::message::Locate_manager_status Locate_status_msg::locate_manager_status() const {
-  // @@protoc_insertion_point(field_get:message.Locate_status_msg.locate_manager_status)
+inline ::message::Locate_manager_status Measure_status_msg::locate_manager_status() const {
+  // @@protoc_insertion_point(field_get:message.Measure_status_msg.locate_manager_status)
   return static_cast< ::message::Locate_manager_status >(locate_manager_status_);
 }
-inline void Locate_status_msg::set_locate_manager_status(::message::Locate_manager_status value) {
+inline void Measure_status_msg::set_locate_manager_status(::message::Locate_manager_status value) {
   assert(::message::Locate_manager_status_IsValid(value));
   set_has_locate_manager_status();
   locate_manager_status_ = value;
-  // @@protoc_insertion_point(field_set:message.Locate_status_msg.locate_manager_status)
+  // @@protoc_insertion_point(field_set:message.Measure_status_msg.locate_manager_status)
 }
 
 // optional .message.Locate_information locate_information_realtime = 5;
-inline bool Locate_status_msg::has_locate_information_realtime() const {
+inline bool Measure_status_msg::has_locate_information_realtime() const {
   return (_has_bits_[0] & 0x00000002u) != 0;
 }
-inline void Locate_status_msg::set_has_locate_information_realtime() {
+inline void Measure_status_msg::set_has_locate_information_realtime() {
   _has_bits_[0] |= 0x00000002u;
 }
-inline void Locate_status_msg::clear_has_locate_information_realtime() {
+inline void Measure_status_msg::clear_has_locate_information_realtime() {
   _has_bits_[0] &= ~0x00000002u;
 }
-inline const ::message::Locate_information& Locate_status_msg::locate_information_realtime() const {
+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.Locate_status_msg.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 ::message::Locate_information* Locate_status_msg::release_locate_information_realtime() {
-  // @@protoc_insertion_point(field_release:message.Locate_status_msg.locate_information_realtime)
+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::Locate_information* Locate_status_msg::mutable_locate_information_realtime() {
+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;
   }
-  // @@protoc_insertion_point(field_mutable:message.Locate_status_msg.locate_information_realtime)
+  // @@protoc_insertion_point(field_mutable:message.Measure_status_msg.locate_information_realtime)
   return locate_information_realtime_;
 }
-inline void Locate_status_msg::set_allocated_locate_information_realtime(::message::Locate_information* locate_information_realtime) {
+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_);
@@ -789,41 +789,41 @@ inline void Locate_status_msg::set_allocated_locate_information_realtime(::messa
     clear_has_locate_information_realtime();
   }
   locate_information_realtime_ = locate_information_realtime;
-  // @@protoc_insertion_point(field_set_allocated:message.Locate_status_msg.locate_information_realtime)
+  // @@protoc_insertion_point(field_set_allocated:message.Measure_status_msg.locate_information_realtime)
 }
 
 // required .message.Error_manager error_manager = 6;
-inline bool Locate_status_msg::has_error_manager() const {
+inline bool Measure_status_msg::has_error_manager() const {
   return (_has_bits_[0] & 0x00000004u) != 0;
 }
-inline void Locate_status_msg::set_has_error_manager() {
+inline void Measure_status_msg::set_has_error_manager() {
   _has_bits_[0] |= 0x00000004u;
 }
-inline void Locate_status_msg::clear_has_error_manager() {
+inline void Measure_status_msg::clear_has_error_manager() {
   _has_bits_[0] &= ~0x00000004u;
 }
-inline const ::message::Error_manager& Locate_status_msg::error_manager() const {
+inline const ::message::Error_manager& Measure_status_msg::error_manager() const {
   const ::message::Error_manager* p = error_manager_;
-  // @@protoc_insertion_point(field_get:message.Locate_status_msg.error_manager)
+  // @@protoc_insertion_point(field_get:message.Measure_status_msg.error_manager)
   return p != NULL ? *p : *reinterpret_cast<const ::message::Error_manager*>(
       &::message::_Error_manager_default_instance_);
 }
-inline ::message::Error_manager* Locate_status_msg::release_error_manager() {
-  // @@protoc_insertion_point(field_release:message.Locate_status_msg.error_manager)
+inline ::message::Error_manager* Measure_status_msg::release_error_manager() {
+  // @@protoc_insertion_point(field_release:message.Measure_status_msg.error_manager)
   clear_has_error_manager();
   ::message::Error_manager* temp = error_manager_;
   error_manager_ = NULL;
   return temp;
 }
-inline ::message::Error_manager* Locate_status_msg::mutable_error_manager() {
+inline ::message::Error_manager* Measure_status_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_status_msg.error_manager)
+  // @@protoc_insertion_point(field_mutable:message.Measure_status_msg.error_manager)
   return error_manager_;
 }
-inline void Locate_status_msg::set_allocated_error_manager(::message::Error_manager* error_manager) {
+inline void Measure_status_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_);
@@ -839,45 +839,45 @@ inline void Locate_status_msg::set_allocated_error_manager(::message::Error_mana
     clear_has_error_manager();
   }
   error_manager_ = error_manager;
-  // @@protoc_insertion_point(field_set_allocated:message.Locate_status_msg.error_manager)
+  // @@protoc_insertion_point(field_set_allocated:message.Measure_status_msg.error_manager)
 }
 
 // -------------------------------------------------------------------
 
-// Locate_request_msg
+// Measure_request_msg
 
 // required .message.Base_msg msg_base = 1;
-inline bool Locate_request_msg::has_msg_base() const {
+inline bool Measure_request_msg::has_msg_base() const {
   return (_has_bits_[0] & 0x00000001u) != 0;
 }
-inline void Locate_request_msg::set_has_msg_base() {
+inline void Measure_request_msg::set_has_msg_base() {
   _has_bits_[0] |= 0x00000001u;
 }
-inline void Locate_request_msg::clear_has_msg_base() {
+inline void Measure_request_msg::clear_has_msg_base() {
   _has_bits_[0] &= ~0x00000001u;
 }
-inline const ::message::Base_msg& Locate_request_msg::msg_base() const {
+inline const ::message::Base_msg& Measure_request_msg::msg_base() const {
   const ::message::Base_msg* p = msg_base_;
-  // @@protoc_insertion_point(field_get:message.Locate_request_msg.msg_base)
+  // @@protoc_insertion_point(field_get:message.Measure_request_msg.msg_base)
   return p != NULL ? *p : *reinterpret_cast<const ::message::Base_msg*>(
       &::message::_Base_msg_default_instance_);
 }
-inline ::message::Base_msg* Locate_request_msg::release_msg_base() {
-  // @@protoc_insertion_point(field_release:message.Locate_request_msg.msg_base)
+inline ::message::Base_msg* Measure_request_msg::release_msg_base() {
+  // @@protoc_insertion_point(field_release:message.Measure_request_msg.msg_base)
   clear_has_msg_base();
   ::message::Base_msg* temp = msg_base_;
   msg_base_ = NULL;
   return temp;
 }
-inline ::message::Base_msg* Locate_request_msg::mutable_msg_base() {
+inline ::message::Base_msg* Measure_request_msg::mutable_msg_base() {
   set_has_msg_base();
   if (msg_base_ == NULL) {
     msg_base_ = new ::message::Base_msg;
   }
-  // @@protoc_insertion_point(field_mutable:message.Locate_request_msg.msg_base)
+  // @@protoc_insertion_point(field_mutable:message.Measure_request_msg.msg_base)
   return msg_base_;
 }
-inline void Locate_request_msg::set_allocated_msg_base(::message::Base_msg* msg_base) {
+inline void Measure_request_msg::set_allocated_msg_base(::message::Base_msg* msg_base) {
   ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
   if (message_arena == NULL) {
     delete reinterpret_cast< ::google::protobuf::MessageLite*>(msg_base_);
@@ -893,93 +893,93 @@ inline void Locate_request_msg::set_allocated_msg_base(::message::Base_msg* msg_
     clear_has_msg_base();
   }
   msg_base_ = msg_base;
-  // @@protoc_insertion_point(field_set_allocated:message.Locate_request_msg.msg_base)
+  // @@protoc_insertion_point(field_set_allocated:message.Measure_request_msg.msg_base)
 }
 
 // required int32 command_id = 2;
-inline bool Locate_request_msg::has_command_id() const {
+inline bool Measure_request_msg::has_command_id() const {
   return (_has_bits_[0] & 0x00000002u) != 0;
 }
-inline void Locate_request_msg::set_has_command_id() {
+inline void Measure_request_msg::set_has_command_id() {
   _has_bits_[0] |= 0x00000002u;
 }
-inline void Locate_request_msg::clear_has_command_id() {
+inline void Measure_request_msg::clear_has_command_id() {
   _has_bits_[0] &= ~0x00000002u;
 }
-inline void Locate_request_msg::clear_command_id() {
+inline void Measure_request_msg::clear_command_id() {
   command_id_ = 0;
   clear_has_command_id();
 }
-inline ::google::protobuf::int32 Locate_request_msg::command_id() const {
-  // @@protoc_insertion_point(field_get:message.Locate_request_msg.command_id)
+inline ::google::protobuf::int32 Measure_request_msg::command_id() const {
+  // @@protoc_insertion_point(field_get:message.Measure_request_msg.command_id)
   return command_id_;
 }
-inline void Locate_request_msg::set_command_id(::google::protobuf::int32 value) {
+inline void Measure_request_msg::set_command_id(::google::protobuf::int32 value) {
   set_has_command_id();
   command_id_ = value;
-  // @@protoc_insertion_point(field_set:message.Locate_request_msg.command_id)
+  // @@protoc_insertion_point(field_set:message.Measure_request_msg.command_id)
 }
 
 // required int32 terminal_id = 3;
-inline bool Locate_request_msg::has_terminal_id() const {
+inline bool Measure_request_msg::has_terminal_id() const {
   return (_has_bits_[0] & 0x00000004u) != 0;
 }
-inline void Locate_request_msg::set_has_terminal_id() {
+inline void Measure_request_msg::set_has_terminal_id() {
   _has_bits_[0] |= 0x00000004u;
 }
-inline void Locate_request_msg::clear_has_terminal_id() {
+inline void Measure_request_msg::clear_has_terminal_id() {
   _has_bits_[0] &= ~0x00000004u;
 }
-inline void Locate_request_msg::clear_terminal_id() {
+inline void Measure_request_msg::clear_terminal_id() {
   terminal_id_ = 0;
   clear_has_terminal_id();
 }
-inline ::google::protobuf::int32 Locate_request_msg::terminal_id() const {
-  // @@protoc_insertion_point(field_get:message.Locate_request_msg.terminal_id)
+inline ::google::protobuf::int32 Measure_request_msg::terminal_id() const {
+  // @@protoc_insertion_point(field_get:message.Measure_request_msg.terminal_id)
   return terminal_id_;
 }
-inline void Locate_request_msg::set_terminal_id(::google::protobuf::int32 value) {
+inline void Measure_request_msg::set_terminal_id(::google::protobuf::int32 value) {
   set_has_terminal_id();
   terminal_id_ = value;
-  // @@protoc_insertion_point(field_set:message.Locate_request_msg.terminal_id)
+  // @@protoc_insertion_point(field_set:message.Measure_request_msg.terminal_id)
 }
 
 // -------------------------------------------------------------------
 
-// Locate_response_msg
+// Measure_response_msg
 
 // required .message.Base_msg msg_base = 1;
-inline bool Locate_response_msg::has_msg_base() const {
+inline bool Measure_response_msg::has_msg_base() const {
   return (_has_bits_[0] & 0x00000001u) != 0;
 }
-inline void Locate_response_msg::set_has_msg_base() {
+inline void Measure_response_msg::set_has_msg_base() {
   _has_bits_[0] |= 0x00000001u;
 }
-inline void Locate_response_msg::clear_has_msg_base() {
+inline void Measure_response_msg::clear_has_msg_base() {
   _has_bits_[0] &= ~0x00000001u;
 }
-inline const ::message::Base_msg& Locate_response_msg::msg_base() const {
+inline const ::message::Base_msg& Measure_response_msg::msg_base() const {
   const ::message::Base_msg* p = msg_base_;
-  // @@protoc_insertion_point(field_get:message.Locate_response_msg.msg_base)
+  // @@protoc_insertion_point(field_get:message.Measure_response_msg.msg_base)
   return p != NULL ? *p : *reinterpret_cast<const ::message::Base_msg*>(
       &::message::_Base_msg_default_instance_);
 }
-inline ::message::Base_msg* Locate_response_msg::release_msg_base() {
-  // @@protoc_insertion_point(field_release:message.Locate_response_msg.msg_base)
+inline ::message::Base_msg* Measure_response_msg::release_msg_base() {
+  // @@protoc_insertion_point(field_release:message.Measure_response_msg.msg_base)
   clear_has_msg_base();
   ::message::Base_msg* temp = msg_base_;
   msg_base_ = NULL;
   return temp;
 }
-inline ::message::Base_msg* Locate_response_msg::mutable_msg_base() {
+inline ::message::Base_msg* Measure_response_msg::mutable_msg_base() {
   set_has_msg_base();
   if (msg_base_ == NULL) {
     msg_base_ = new ::message::Base_msg;
   }
-  // @@protoc_insertion_point(field_mutable:message.Locate_response_msg.msg_base)
+  // @@protoc_insertion_point(field_mutable:message.Measure_response_msg.msg_base)
   return msg_base_;
 }
-inline void Locate_response_msg::set_allocated_msg_base(::message::Base_msg* msg_base) {
+inline void Measure_response_msg::set_allocated_msg_base(::message::Base_msg* msg_base) {
   ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
   if (message_arena == NULL) {
     delete reinterpret_cast< ::google::protobuf::MessageLite*>(msg_base_);
@@ -995,89 +995,89 @@ inline void Locate_response_msg::set_allocated_msg_base(::message::Base_msg* msg
     clear_has_msg_base();
   }
   msg_base_ = msg_base;
-  // @@protoc_insertion_point(field_set_allocated:message.Locate_response_msg.msg_base)
+  // @@protoc_insertion_point(field_set_allocated:message.Measure_response_msg.msg_base)
 }
 
 // required int32 command_id = 2;
-inline bool Locate_response_msg::has_command_id() const {
+inline bool Measure_response_msg::has_command_id() const {
   return (_has_bits_[0] & 0x00000008u) != 0;
 }
-inline void Locate_response_msg::set_has_command_id() {
+inline void Measure_response_msg::set_has_command_id() {
   _has_bits_[0] |= 0x00000008u;
 }
-inline void Locate_response_msg::clear_has_command_id() {
+inline void Measure_response_msg::clear_has_command_id() {
   _has_bits_[0] &= ~0x00000008u;
 }
-inline void Locate_response_msg::clear_command_id() {
+inline void Measure_response_msg::clear_command_id() {
   command_id_ = 0;
   clear_has_command_id();
 }
-inline ::google::protobuf::int32 Locate_response_msg::command_id() const {
-  // @@protoc_insertion_point(field_get:message.Locate_response_msg.command_id)
+inline ::google::protobuf::int32 Measure_response_msg::command_id() const {
+  // @@protoc_insertion_point(field_get:message.Measure_response_msg.command_id)
   return command_id_;
 }
-inline void Locate_response_msg::set_command_id(::google::protobuf::int32 value) {
+inline void Measure_response_msg::set_command_id(::google::protobuf::int32 value) {
   set_has_command_id();
   command_id_ = value;
-  // @@protoc_insertion_point(field_set:message.Locate_response_msg.command_id)
+  // @@protoc_insertion_point(field_set:message.Measure_response_msg.command_id)
 }
 
 // required int32 terminal_id = 3;
-inline bool Locate_response_msg::has_terminal_id() const {
+inline bool Measure_response_msg::has_terminal_id() const {
   return (_has_bits_[0] & 0x00000010u) != 0;
 }
-inline void Locate_response_msg::set_has_terminal_id() {
+inline void Measure_response_msg::set_has_terminal_id() {
   _has_bits_[0] |= 0x00000010u;
 }
-inline void Locate_response_msg::clear_has_terminal_id() {
+inline void Measure_response_msg::clear_has_terminal_id() {
   _has_bits_[0] &= ~0x00000010u;
 }
-inline void Locate_response_msg::clear_terminal_id() {
+inline void Measure_response_msg::clear_terminal_id() {
   terminal_id_ = 0;
   clear_has_terminal_id();
 }
-inline ::google::protobuf::int32 Locate_response_msg::terminal_id() const {
-  // @@protoc_insertion_point(field_get:message.Locate_response_msg.terminal_id)
+inline ::google::protobuf::int32 Measure_response_msg::terminal_id() const {
+  // @@protoc_insertion_point(field_get:message.Measure_response_msg.terminal_id)
   return terminal_id_;
 }
-inline void Locate_response_msg::set_terminal_id(::google::protobuf::int32 value) {
+inline void Measure_response_msg::set_terminal_id(::google::protobuf::int32 value) {
   set_has_terminal_id();
   terminal_id_ = value;
-  // @@protoc_insertion_point(field_set:message.Locate_response_msg.terminal_id)
+  // @@protoc_insertion_point(field_set:message.Measure_response_msg.terminal_id)
 }
 
 // optional .message.Locate_information locate_information = 4;
-inline bool Locate_response_msg::has_locate_information() const {
+inline bool Measure_response_msg::has_locate_information() const {
   return (_has_bits_[0] & 0x00000002u) != 0;
 }
-inline void Locate_response_msg::set_has_locate_information() {
+inline void Measure_response_msg::set_has_locate_information() {
   _has_bits_[0] |= 0x00000002u;
 }
-inline void Locate_response_msg::clear_has_locate_information() {
+inline void Measure_response_msg::clear_has_locate_information() {
   _has_bits_[0] &= ~0x00000002u;
 }
-inline const ::message::Locate_information& Locate_response_msg::locate_information() const {
+inline const ::message::Locate_information& Measure_response_msg::locate_information() const {
   const ::message::Locate_information* p = locate_information_;
-  // @@protoc_insertion_point(field_get:message.Locate_response_msg.locate_information)
+  // @@protoc_insertion_point(field_get:message.Measure_response_msg.locate_information)
   return p != NULL ? *p : *reinterpret_cast<const ::message::Locate_information*>(
       &::message::_Locate_information_default_instance_);
 }
-inline ::message::Locate_information* Locate_response_msg::release_locate_information() {
-  // @@protoc_insertion_point(field_release:message.Locate_response_msg.locate_information)
+inline ::message::Locate_information* Measure_response_msg::release_locate_information() {
+  // @@protoc_insertion_point(field_release:message.Measure_response_msg.locate_information)
   clear_has_locate_information();
   ::message::Locate_information* temp = locate_information_;
   locate_information_ = NULL;
   return temp;
 }
-inline ::message::Locate_information* Locate_response_msg::mutable_locate_information() {
+inline ::message::Locate_information* Measure_response_msg::mutable_locate_information() {
   set_has_locate_information();
   if (locate_information_ == NULL) {
     locate_information_ = new ::message::Locate_information;
   }
-  // @@protoc_insertion_point(field_mutable:message.Locate_response_msg.locate_information)
+  // @@protoc_insertion_point(field_mutable:message.Measure_response_msg.locate_information)
   return locate_information_;
 }
-inline void Locate_response_msg::set_allocated_locate_information(::message::Locate_information* locate_information) {
+inline void Measure_response_msg::set_allocated_locate_information(::message::Locate_information* locate_information) {
   ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
   if (message_arena == NULL) {
     delete reinterpret_cast< ::google::protobuf::MessageLite*>(locate_information_);
@@ -1093,41 +1093,41 @@ inline void Locate_response_msg::set_allocated_locate_information(::message::Loc
     clear_has_locate_information();
   }
   locate_information_ = locate_information;
-  // @@protoc_insertion_point(field_set_allocated:message.Locate_response_msg.locate_information)
+  // @@protoc_insertion_point(field_set_allocated:message.Measure_response_msg.locate_information)
 }
 
 // required .message.Error_manager error_manager = 5;
-inline bool Locate_response_msg::has_error_manager() const {
+inline bool Measure_response_msg::has_error_manager() const {
   return (_has_bits_[0] & 0x00000004u) != 0;
 }
-inline void Locate_response_msg::set_has_error_manager() {
+inline void Measure_response_msg::set_has_error_manager() {
   _has_bits_[0] |= 0x00000004u;
 }
-inline void Locate_response_msg::clear_has_error_manager() {
+inline void Measure_response_msg::clear_has_error_manager() {
   _has_bits_[0] &= ~0x00000004u;
 }
-inline const ::message::Error_manager& Locate_response_msg::error_manager() const {
+inline const ::message::Error_manager& Measure_response_msg::error_manager() const {
   const ::message::Error_manager* p = error_manager_;
-  // @@protoc_insertion_point(field_get:message.Locate_response_msg.error_manager)
+  // @@protoc_insertion_point(field_get:message.Measure_response_msg.error_manager)
   return p != NULL ? *p : *reinterpret_cast<const ::message::Error_manager*>(
       &::message::_Error_manager_default_instance_);
 }
-inline ::message::Error_manager* Locate_response_msg::release_error_manager() {
-  // @@protoc_insertion_point(field_release:message.Locate_response_msg.error_manager)
+inline ::message::Error_manager* Measure_response_msg::release_error_manager() {
+  // @@protoc_insertion_point(field_release:message.Measure_response_msg.error_manager)
   clear_has_error_manager();
   ::message::Error_manager* temp = error_manager_;
   error_manager_ = NULL;
   return temp;
 }
-inline ::message::Error_manager* Locate_response_msg::mutable_error_manager() {
+inline ::message::Error_manager* Measure_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_response_msg.error_manager)
+  // @@protoc_insertion_point(field_mutable:message.Measure_response_msg.error_manager)
   return error_manager_;
 }
-inline void Locate_response_msg::set_allocated_error_manager(::message::Error_manager* error_manager) {
+inline void Measure_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_);
@@ -1143,7 +1143,7 @@ inline void Locate_response_msg::set_allocated_error_manager(::message::Error_ma
     clear_has_error_manager();
   }
   error_manager_ = error_manager;
-  // @@protoc_insertion_point(field_set_allocated:message.Locate_response_msg.error_manager)
+  // @@protoc_insertion_point(field_set_allocated:message.Measure_response_msg.error_manager)
 }
 
 #ifdef __GNUC__

+ 4 - 3
message/measure_message.proto

@@ -34,7 +34,7 @@ enum Locate_manager_status
 	
 	
 //定位模块状态
-message Locate_status_msg
+message Measure_status_msg
 {
     required Base_msg                   msg_type=1;                 //消息类型
 
@@ -48,7 +48,7 @@ message Locate_status_msg
 
 
 //定位请求消息
-message Locate_request_msg
+message Measure_request_msg
 {
     required Base_msg                   msg_base=1;         //消息类型
     required int32                      command_id=2;                   //指令唯一标识符id
@@ -56,11 +56,12 @@ message Locate_request_msg
 }
 
 //定位测量返回消息
-message Locate_response_msg
+message Measure_response_msg
 {
     required Base_msg                   msg_base=1;                          //消息类型
     required int32                      command_id=2;                   //指令唯一标识符id
     required int32                      terminal_id=3;
+
     optional Locate_information         locate_information=4;
     required Error_manager              error_manager = 5;
 }

+ 2 - 1
message/message_base.proto

@@ -80,4 +80,5 @@ message Locate_information
     optional float locate_wheel_base = 7;	    //整车的轮距; 前后轮的距离; 用于机器人或agv的抓车
     optional float locate_wheel_width = 8;	    //整车的轮距; 左右轮的距离; 用于机器人或agv的抓车
     optional bool locate_correct = 9;		    //整车的校准标记位
-}
+}
+

+ 0 - 744
setting.pb.cc

@@ -1,744 +0,0 @@
-// Generated by the protocol buffer compiler.  DO NOT EDIT!
-// source: setting.proto
-
-#include "setting.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 setting {
-class locate_settingDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<locate_setting>
-      _instance;
-} _locate_setting_default_instance_;
-class global_settingDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<global_setting>
-      _instance;
-} _global_setting_default_instance_;
-}  // namespace setting
-namespace protobuf_setting_2eproto {
-void InitDefaultslocate_settingImpl() {
-  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 = &::setting::_locate_setting_default_instance_;
-    new (ptr) ::setting::locate_setting();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::setting::locate_setting::InitAsDefaultInstance();
-}
-
-void InitDefaultslocate_setting() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultslocate_settingImpl);
-}
-
-void InitDefaultsglobal_settingImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  protobuf_setting_2eproto::InitDefaultslocate_setting();
-  {
-    void* ptr = &::setting::_global_setting_default_instance_;
-    new (ptr) ::setting::global_setting();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::setting::global_setting::InitAsDefaultInstance();
-}
-
-void InitDefaultsglobal_setting() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsglobal_settingImpl);
-}
-
-::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(::setting::locate_setting, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::setting::locate_setting, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::setting::locate_setting, ip_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::setting::locate_setting, port_),
-  0,
-  1,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::setting::global_setting, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::setting::global_setting, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::setting::global_setting, locate_parameter_),
-  0,
-};
-static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
-  { 0, 7, sizeof(::setting::locate_setting)},
-  { 9, 15, sizeof(::setting::global_setting)},
-};
-
-static ::google::protobuf::Message const * const file_default_instances[] = {
-  reinterpret_cast<const ::google::protobuf::Message*>(&::setting::_locate_setting_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::setting::_global_setting_default_instance_),
-};
-
-void protobuf_AssignDescriptors() {
-  AddDescriptors();
-  ::google::protobuf::MessageFactory* factory = NULL;
-  AssignDescriptors(
-      "setting.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\rsetting.proto\022\007setting\"*\n\016locate_setti"
-      "ng\022\n\n\002ip\030\001 \002(\t\022\014\n\004port\030\002 \002(\005\"C\n\016global_s"
-      "etting\0221\n\020locate_parameter\030\001 \002(\0132\027.setti"
-      "ng.locate_setting"
-  };
-  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
-      descriptor, 137);
-  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
-    "setting.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_setting_2eproto
-namespace setting {
-
-// ===================================================================
-
-void locate_setting::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int locate_setting::kIpFieldNumber;
-const int locate_setting::kPortFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-locate_setting::locate_setting()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_setting_2eproto::InitDefaultslocate_setting();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:setting.locate_setting)
-}
-locate_setting::locate_setting(const locate_setting& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ip_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_ip()) {
-    ip_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.ip_);
-  }
-  port_ = from.port_;
-  // @@protoc_insertion_point(copy_constructor:setting.locate_setting)
-}
-
-void locate_setting::SharedCtor() {
-  _cached_size_ = 0;
-  ip_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  port_ = 0;
-}
-
-locate_setting::~locate_setting() {
-  // @@protoc_insertion_point(destructor:setting.locate_setting)
-  SharedDtor();
-}
-
-void locate_setting::SharedDtor() {
-  ip_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-
-void locate_setting::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* locate_setting::descriptor() {
-  ::protobuf_setting_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_setting_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const locate_setting& locate_setting::default_instance() {
-  ::protobuf_setting_2eproto::InitDefaultslocate_setting();
-  return *internal_default_instance();
-}
-
-locate_setting* locate_setting::New(::google::protobuf::Arena* arena) const {
-  locate_setting* n = new locate_setting;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
-}
-
-void locate_setting::Clear() {
-// @@protoc_insertion_point(message_clear_start:setting.locate_setting)
-  ::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_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-    (*ip_.UnsafeRawStringPointer())->clear();
-  }
-  port_ = 0;
-  _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool locate_setting::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:setting.locate_setting)
-  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 = 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()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->ip().data(), static_cast<int>(this->ip().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "setting.locate_setting.ip");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // required int32 port = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          set_has_port();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &port_)));
-        } 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:setting.locate_setting)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:setting.locate_setting)
-  return false;
-#undef DO_
-}
-
-void locate_setting::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:setting.locate_setting)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // required string ip = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->ip().data(), static_cast<int>(this->ip().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "setting.locate_setting.ip");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->ip(), output);
-  }
-
-  // required int32 port = 2;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->port(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:setting.locate_setting)
-}
-
-::google::protobuf::uint8* locate_setting::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:setting.locate_setting)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // required string ip = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->ip().data(), static_cast<int>(this->ip().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "setting.locate_setting.ip");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        1, this->ip(), target);
-  }
-
-  // required int32 port = 2;
-  if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->port(), 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:setting.locate_setting)
-  return target;
-}
-
-size_t locate_setting::RequiredFieldsByteSizeFallback() const {
-// @@protoc_insertion_point(required_fields_byte_size_fallback_start:setting.locate_setting)
-  size_t total_size = 0;
-
-  if (has_ip()) {
-    // required string ip = 1;
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->ip());
-  }
-
-  if (has_port()) {
-    // required int32 port = 2;
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::Int32Size(
-        this->port());
-  }
-
-  return total_size;
-}
-size_t locate_setting::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:setting.locate_setting)
-  size_t total_size = 0;
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
-  if (((_has_bits_[0] & 0x00000003) ^ 0x00000003) == 0) {  // All required fields are present.
-    // required string ip = 1;
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->ip());
-
-    // required int32 port = 2;
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::Int32Size(
-        this->port());
-
-  } else {
-    total_size += RequiredFieldsByteSizeFallback();
-  }
-  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 locate_setting::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:setting.locate_setting)
-  GOOGLE_DCHECK_NE(&from, this);
-  const locate_setting* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const locate_setting>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:setting.locate_setting)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:setting.locate_setting)
-    MergeFrom(*source);
-  }
-}
-
-void locate_setting::MergeFrom(const locate_setting& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:setting.locate_setting)
-  GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 3u) {
-    if (cached_has_bits & 0x00000001u) {
-      set_has_ip();
-      ip_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.ip_);
-    }
-    if (cached_has_bits & 0x00000002u) {
-      port_ = from.port_;
-    }
-    _has_bits_[0] |= cached_has_bits;
-  }
-}
-
-void locate_setting::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:setting.locate_setting)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-void locate_setting::CopyFrom(const locate_setting& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:setting.locate_setting)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-bool locate_setting::IsInitialized() const {
-  if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;
-  return true;
-}
-
-void locate_setting::Swap(locate_setting* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
-void locate_setting::InternalSwap(locate_setting* other) {
-  using std::swap;
-  ip_.Swap(&other->ip_);
-  swap(port_, other->port_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-}
-
-::google::protobuf::Metadata locate_setting::GetMetadata() const {
-  protobuf_setting_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_setting_2eproto::file_level_metadata[kIndexInFileMessages];
-}
-
-
-// ===================================================================
-
-void global_setting::InitAsDefaultInstance() {
-  ::setting::_global_setting_default_instance_._instance.get_mutable()->locate_parameter_ = const_cast< ::setting::locate_setting*>(
-      ::setting::locate_setting::internal_default_instance());
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int global_setting::kLocateParameterFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-global_setting::global_setting()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_setting_2eproto::InitDefaultsglobal_setting();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:setting.global_setting)
-}
-global_setting::global_setting(const global_setting& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  if (from.has_locate_parameter()) {
-    locate_parameter_ = new ::setting::locate_setting(*from.locate_parameter_);
-  } else {
-    locate_parameter_ = NULL;
-  }
-  // @@protoc_insertion_point(copy_constructor:setting.global_setting)
-}
-
-void global_setting::SharedCtor() {
-  _cached_size_ = 0;
-  locate_parameter_ = NULL;
-}
-
-global_setting::~global_setting() {
-  // @@protoc_insertion_point(destructor:setting.global_setting)
-  SharedDtor();
-}
-
-void global_setting::SharedDtor() {
-  if (this != internal_default_instance()) delete locate_parameter_;
-}
-
-void global_setting::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* global_setting::descriptor() {
-  ::protobuf_setting_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_setting_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const global_setting& global_setting::default_instance() {
-  ::protobuf_setting_2eproto::InitDefaultsglobal_setting();
-  return *internal_default_instance();
-}
-
-global_setting* global_setting::New(::google::protobuf::Arena* arena) const {
-  global_setting* n = new global_setting;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
-}
-
-void global_setting::Clear() {
-// @@protoc_insertion_point(message_clear_start:setting.global_setting)
-  ::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(locate_parameter_ != NULL);
-    locate_parameter_->Clear();
-  }
-  _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool global_setting::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:setting.global_setting)
-  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 .setting.locate_setting locate_parameter = 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_locate_parameter()));
-        } 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:setting.global_setting)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:setting.global_setting)
-  return false;
-#undef DO_
-}
-
-void global_setting::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:setting.global_setting)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // required .setting.locate_setting locate_parameter = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      1, *this->locate_parameter_, output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:setting.global_setting)
-}
-
-::google::protobuf::uint8* global_setting::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:setting.global_setting)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // required .setting.locate_setting locate_parameter = 1;
-  if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        1, *this->locate_parameter_, 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:setting.global_setting)
-  return target;
-}
-
-size_t global_setting::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:setting.global_setting)
-  size_t total_size = 0;
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
-  // required .setting.locate_setting locate_parameter = 1;
-  if (has_locate_parameter()) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::MessageSize(
-        *this->locate_parameter_);
-  }
-  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 global_setting::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:setting.global_setting)
-  GOOGLE_DCHECK_NE(&from, this);
-  const global_setting* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const global_setting>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:setting.global_setting)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:setting.global_setting)
-    MergeFrom(*source);
-  }
-}
-
-void global_setting::MergeFrom(const global_setting& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:setting.global_setting)
-  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_locate_parameter()) {
-    mutable_locate_parameter()->::setting::locate_setting::MergeFrom(from.locate_parameter());
-  }
-}
-
-void global_setting::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:setting.global_setting)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-void global_setting::CopyFrom(const global_setting& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:setting.global_setting)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-bool global_setting::IsInitialized() const {
-  if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
-  if (has_locate_parameter()) {
-    if (!this->locate_parameter_->IsInitialized()) return false;
-  }
-  return true;
-}
-
-void global_setting::Swap(global_setting* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
-void global_setting::InternalSwap(global_setting* other) {
-  using std::swap;
-  swap(locate_parameter_, other->locate_parameter_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-}
-
-::google::protobuf::Metadata global_setting::GetMetadata() const {
-  protobuf_setting_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_setting_2eproto::file_level_metadata[kIndexInFileMessages];
-}
-
-
-// @@protoc_insertion_point(namespace_scope)
-}  // namespace setting
-
-// @@protoc_insertion_point(global_scope)

+ 0 - 475
setting.pb.h

@@ -1,475 +0,0 @@
-// Generated by the protocol buffer compiler.  DO NOT EDIT!
-// source: setting.proto
-
-#ifndef PROTOBUF_setting_2eproto__INCLUDED
-#define PROTOBUF_setting_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_setting_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 InitDefaultslocate_settingImpl();
-void InitDefaultslocate_setting();
-void InitDefaultsglobal_settingImpl();
-void InitDefaultsglobal_setting();
-inline void InitDefaults() {
-  InitDefaultslocate_setting();
-  InitDefaultsglobal_setting();
-}
-}  // namespace protobuf_setting_2eproto
-namespace setting {
-class global_setting;
-class global_settingDefaultTypeInternal;
-extern global_settingDefaultTypeInternal _global_setting_default_instance_;
-class locate_setting;
-class locate_settingDefaultTypeInternal;
-extern locate_settingDefaultTypeInternal _locate_setting_default_instance_;
-}  // namespace setting
-namespace setting {
-
-// ===================================================================
-
-class locate_setting : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:setting.locate_setting) */ {
- public:
-  locate_setting();
-  virtual ~locate_setting();
-
-  locate_setting(const locate_setting& from);
-
-  inline locate_setting& operator=(const locate_setting& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
-  locate_setting(locate_setting&& from) noexcept
-    : locate_setting() {
-    *this = ::std::move(from);
-  }
-
-  inline locate_setting& operator=(locate_setting&& 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 locate_setting& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
-  static inline const locate_setting* internal_default_instance() {
-    return reinterpret_cast<const locate_setting*>(
-               &_locate_setting_default_instance_);
-  }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
-    0;
-
-  void Swap(locate_setting* other);
-  friend void swap(locate_setting& a, locate_setting& b) {
-    a.Swap(&b);
-  }
-
-  // implements Message ----------------------------------------------
-
-  inline locate_setting* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  locate_setting* 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 locate_setting& from);
-  void MergeFrom(const locate_setting& 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(locate_setting* 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 = 1;
-  bool has_ip() const;
-  void clear_ip();
-  static const int kIpFieldNumber = 1;
-  const ::std::string& ip() const;
-  void set_ip(const ::std::string& value);
-  #if LANG_CXX11
-  void set_ip(::std::string&& value);
-  #endif
-  void set_ip(const char* value);
-  void set_ip(const char* value, size_t size);
-  ::std::string* mutable_ip();
-  ::std::string* release_ip();
-  void set_allocated_ip(::std::string* ip);
-
-  // required int32 port = 2;
-  bool has_port() const;
-  void clear_port();
-  static const int kPortFieldNumber = 2;
-  ::google::protobuf::int32 port() const;
-  void set_port(::google::protobuf::int32 value);
-
-  // @@protoc_insertion_point(class_scope:setting.locate_setting)
- private:
-  void set_has_ip();
-  void clear_has_ip();
-  void set_has_port();
-  void clear_has_port();
-
-  // helper for ByteSizeLong()
-  size_t RequiredFieldsByteSizeFallback() const;
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::internal::ArenaStringPtr ip_;
-  ::google::protobuf::int32 port_;
-  friend struct ::protobuf_setting_2eproto::TableStruct;
-  friend void ::protobuf_setting_2eproto::InitDefaultslocate_settingImpl();
-};
-// -------------------------------------------------------------------
-
-class global_setting : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:setting.global_setting) */ {
- public:
-  global_setting();
-  virtual ~global_setting();
-
-  global_setting(const global_setting& from);
-
-  inline global_setting& operator=(const global_setting& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
-  global_setting(global_setting&& from) noexcept
-    : global_setting() {
-    *this = ::std::move(from);
-  }
-
-  inline global_setting& operator=(global_setting&& 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 global_setting& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
-  static inline const global_setting* internal_default_instance() {
-    return reinterpret_cast<const global_setting*>(
-               &_global_setting_default_instance_);
-  }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
-    1;
-
-  void Swap(global_setting* other);
-  friend void swap(global_setting& a, global_setting& b) {
-    a.Swap(&b);
-  }
-
-  // implements Message ----------------------------------------------
-
-  inline global_setting* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  global_setting* 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 global_setting& from);
-  void MergeFrom(const global_setting& 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(global_setting* 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 .setting.locate_setting locate_parameter = 1;
-  bool has_locate_parameter() const;
-  void clear_locate_parameter();
-  static const int kLocateParameterFieldNumber = 1;
-  const ::setting::locate_setting& locate_parameter() const;
-  ::setting::locate_setting* release_locate_parameter();
-  ::setting::locate_setting* mutable_locate_parameter();
-  void set_allocated_locate_parameter(::setting::locate_setting* locate_parameter);
-
-  // @@protoc_insertion_point(class_scope:setting.global_setting)
- private:
-  void set_has_locate_parameter();
-  void clear_has_locate_parameter();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::setting::locate_setting* locate_parameter_;
-  friend struct ::protobuf_setting_2eproto::TableStruct;
-  friend void ::protobuf_setting_2eproto::InitDefaultsglobal_settingImpl();
-};
-// ===================================================================
-
-
-// ===================================================================
-
-#ifdef __GNUC__
-  #pragma GCC diagnostic push
-  #pragma GCC diagnostic ignored "-Wstrict-aliasing"
-#endif  // __GNUC__
-// locate_setting
-
-// required string ip = 1;
-inline bool locate_setting::has_ip() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void locate_setting::set_has_ip() {
-  _has_bits_[0] |= 0x00000001u;
-}
-inline void locate_setting::clear_has_ip() {
-  _has_bits_[0] &= ~0x00000001u;
-}
-inline void locate_setting::clear_ip() {
-  ip_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_ip();
-}
-inline const ::std::string& locate_setting::ip() const {
-  // @@protoc_insertion_point(field_get:setting.locate_setting.ip)
-  return ip_.GetNoArena();
-}
-inline void locate_setting::set_ip(const ::std::string& value) {
-  set_has_ip();
-  ip_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
-  // @@protoc_insertion_point(field_set:setting.locate_setting.ip)
-}
-#if LANG_CXX11
-inline void locate_setting::set_ip(::std::string&& value) {
-  set_has_ip();
-  ip_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:setting.locate_setting.ip)
-}
-#endif
-inline void locate_setting::set_ip(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_ip();
-  ip_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:setting.locate_setting.ip)
-}
-inline void locate_setting::set_ip(const char* value, size_t size) {
-  set_has_ip();
-  ip_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:setting.locate_setting.ip)
-}
-inline ::std::string* locate_setting::mutable_ip() {
-  set_has_ip();
-  // @@protoc_insertion_point(field_mutable:setting.locate_setting.ip)
-  return ip_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-inline ::std::string* locate_setting::release_ip() {
-  // @@protoc_insertion_point(field_release:setting.locate_setting.ip)
-  clear_has_ip();
-  return ip_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-inline void locate_setting::set_allocated_ip(::std::string* ip) {
-  if (ip != NULL) {
-    set_has_ip();
-  } else {
-    clear_has_ip();
-  }
-  ip_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ip);
-  // @@protoc_insertion_point(field_set_allocated:setting.locate_setting.ip)
-}
-
-// required int32 port = 2;
-inline bool locate_setting::has_port() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void locate_setting::set_has_port() {
-  _has_bits_[0] |= 0x00000002u;
-}
-inline void locate_setting::clear_has_port() {
-  _has_bits_[0] &= ~0x00000002u;
-}
-inline void locate_setting::clear_port() {
-  port_ = 0;
-  clear_has_port();
-}
-inline ::google::protobuf::int32 locate_setting::port() const {
-  // @@protoc_insertion_point(field_get:setting.locate_setting.port)
-  return port_;
-}
-inline void locate_setting::set_port(::google::protobuf::int32 value) {
-  set_has_port();
-  port_ = value;
-  // @@protoc_insertion_point(field_set:setting.locate_setting.port)
-}
-
-// -------------------------------------------------------------------
-
-// global_setting
-
-// required .setting.locate_setting locate_parameter = 1;
-inline bool global_setting::has_locate_parameter() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void global_setting::set_has_locate_parameter() {
-  _has_bits_[0] |= 0x00000001u;
-}
-inline void global_setting::clear_has_locate_parameter() {
-  _has_bits_[0] &= ~0x00000001u;
-}
-inline void global_setting::clear_locate_parameter() {
-  if (locate_parameter_ != NULL) locate_parameter_->Clear();
-  clear_has_locate_parameter();
-}
-inline const ::setting::locate_setting& global_setting::locate_parameter() const {
-  const ::setting::locate_setting* p = locate_parameter_;
-  // @@protoc_insertion_point(field_get:setting.global_setting.locate_parameter)
-  return p != NULL ? *p : *reinterpret_cast<const ::setting::locate_setting*>(
-      &::setting::_locate_setting_default_instance_);
-}
-inline ::setting::locate_setting* global_setting::release_locate_parameter() {
-  // @@protoc_insertion_point(field_release:setting.global_setting.locate_parameter)
-  clear_has_locate_parameter();
-  ::setting::locate_setting* temp = locate_parameter_;
-  locate_parameter_ = NULL;
-  return temp;
-}
-inline ::setting::locate_setting* global_setting::mutable_locate_parameter() {
-  set_has_locate_parameter();
-  if (locate_parameter_ == NULL) {
-    locate_parameter_ = new ::setting::locate_setting;
-  }
-  // @@protoc_insertion_point(field_mutable:setting.global_setting.locate_parameter)
-  return locate_parameter_;
-}
-inline void global_setting::set_allocated_locate_parameter(::setting::locate_setting* locate_parameter) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
-    delete locate_parameter_;
-  }
-  if (locate_parameter) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
-    if (message_arena != submessage_arena) {
-      locate_parameter = ::google::protobuf::internal::GetOwnedMessage(
-          message_arena, locate_parameter, submessage_arena);
-    }
-    set_has_locate_parameter();
-  } else {
-    clear_has_locate_parameter();
-  }
-  locate_parameter_ = locate_parameter;
-  // @@protoc_insertion_point(field_set_allocated:setting.global_setting.locate_parameter)
-}
-
-#ifdef __GNUC__
-  #pragma GCC diagnostic pop
-#endif  // __GNUC__
-// -------------------------------------------------------------------
-
-
-// @@protoc_insertion_point(namespace_scope)
-
-}  // namespace setting
-
-// @@protoc_insertion_point(global_scope)
-
-#endif  // PROTOBUF_setting_2eproto__INCLUDED

+ 0 - 15
setting.proto

@@ -1,15 +0,0 @@
-syntax = "proto2";
-package setting;
-
-message locate_setting
-{
-    required string ip=1;
-    required int32 port=2;
-
-}
-
-message global_setting
-{
-    required locate_setting locate_parameter=1;
-}
-

+ 4 - 3
setting/communication.prototxt

@@ -3,11 +3,12 @@
 communication_parameters
 {
 
-   bind_string:"tcp://192.168.2.166:9000"
-   connect_string_vector:"tcp://192.168.2.166:9001"
+#   bind_string:"tcp://192.168.2.166:9000"
+ #  connect_string_vector:"tcp://192.168.2.166:9001"
  # connect_string_vector:"tcp://192.168.2.166:9002"
 
-   connect_string_vector:"tcp://192.168.2.125:9876"
+  # connect_string_vector:"tcp://192.168.2.125:9876"
+   connect_string_vector:"tcp://192.168.2.166:1234"
 
 }
 

+ 1 - 12
system/system_communication.cpp

@@ -17,18 +17,7 @@ System_communication::~System_communication()
 //定时封装发送消息, 一般为心跳和状态信息, 需要子类重载
 Error_manager System_communication::encapsulate_send_data()
 {
-	char buf[256] = {0};
-	static unsigned int t_heartbeat = 0;
-	sprintf(buf, "Communication_socket_base, heartbeat = %d\0\0\0", t_heartbeat);
-	t_heartbeat++;
-
-	Binary_buf* tp_buf = new Binary_buf(buf, strlen(buf)+1);//+1是为了保证发送了结束符, 方便打印
-	bool is_push = m_send_data_list.push(tp_buf);
-	if ( is_push == false )
-	{
-		return Error_manager(Error_code::CONTAINER_IS_TERMINATE, Error_level::MINOR_ERROR,
-							 " Communication_socket_base::encapsulate_msg error ");
-	}
+
 	return Error_code::SUCCESS;
 }
 

+ 12 - 10
test.txt

@@ -1,13 +1,15 @@
-//消息类型定义,每个在网络上传输的消息必须含有这个属性
-	enum Message_type
+enum Communicator
 	{
-		COMMAND_MESSAGE				= 0X01,                //指令消息
+		eEmpty=0x0000,
+		eMain=0x0001,    //主流程
 
-		LOCATE_STATUS_MESSAGE		= 0X11,                	//定位模块状态消息
-		LOCATE_REQUEST_MESSAGE		= 0X12,               	//定位请求消息
-		LOCATE_RESPONSE_MESSAGE		= 0X13,              	//定位反馈消息
-
-		HARWARE_STATU_MESSAGE		= 0X21,                	//调度模块硬件状态消息
-		EXECUTE_REQUEST_MESSAGE		= 0X22,              	//请求调度消息
-		EXECUTE_RESPONSE_MESSAGE	= 0X23,             	//调度结果反馈消息
+		eTerminor=0x0100,
+		//数据表
+		eTable=0x0200,
+		//测量单元
+		eMeasurer=0x0300,
+		//调度机构
+		eProcess=0x0400,
+		//...
+		
 	},