Преглед изворни кода

2022 0426 楚天车位管理 通信改为使用nng

wk пре 3 година
родитељ
комит
9311dc18a7

+ 1 - 0
CMakeLists.txt

@@ -44,6 +44,7 @@ add_executable(parkspace_test
 target_link_libraries(parkspace_test
         nnxx
         nanomsg
+        nng
         ${PROTOBUF_LIBRARIES}
         ${PCL_LIBRARIES}
         /usr/local/lib/libglog.a

+ 69 - 10
communication/communication_socket_base.cpp

@@ -48,6 +48,13 @@ Error_manager Communication_socket_base::communication_init_from_protobuf(Commun
 	LOG(INFO) << " ---Communication_socket_base::communication_init_from_protobuf() run--- "<< this;
 	Error_manager t_error;
 
+	int result = nng_bus0_open(&m_socket_bus);
+	if ( result != 0 )
+	{
+	    return Error_manager(Error_code::COMMUNICATION_INIT_ERROR, Error_level::MINOR_ERROR,
+	    					"communication_init nng_bus0_open error ");
+	}
+
 	if ( communication_parameter_all.communication_parameters().has_bind_string() )
 	{
 		t_error = communication_bind(communication_parameter_all.communication_parameters().bind_string());
@@ -78,6 +85,13 @@ Error_manager Communication_socket_base::communication_init(std::string bind_str
 	LOG(INFO) << " ---Communication_socket_base::communication_init() run--- "<< this;
 	Error_manager t_error;
 
+	int t_result = nng_bus0_open(&m_socket_bus);
+	if ( t_result != 0 )
+	{
+		return Error_manager(Error_code::COMMUNICATION_INIT_ERROR, Error_level::MINOR_ERROR,
+							 "communication_init nng_bus0_open error ");
+	}
+
 	t_error = communication_bind(bind_string);
 	if ( t_error != Error_code::SUCCESS )
 	{
@@ -102,11 +116,19 @@ Error_manager Communication_socket_base::communication_bind(std::string bind_str
 	int t_socket_result;
 
 	//m_socket 自己作为一个服务器, 绑定一个端口
-	t_socket_result = m_socket.bind(bind_string);
-	if ( t_socket_result <0 )
+//	t_socket_result = m_socket.bind(bind_string);
+//	if ( t_socket_result <0 )
+//	{
+//		return Error_manager(Error_code::COMMUNICATION_BIND_ERROR, Error_level::MINOR_ERROR,
+//							 " m_socket.bind error ");
+//	}
+
+	//m_socket 自己作为一个服务器, 绑定一个端口
+	int t_result = nng_listen( m_socket_bus, bind_string.c_str(), nullptr, NNG_FLAG_NONBLOCK );
+	if ( t_result != 0 )
 	{
 		return Error_manager(Error_code::COMMUNICATION_BIND_ERROR, Error_level::MINOR_ERROR,
-							 " m_socket.bind error ");
+							 "communication_bind nng_listen error ");
 	}
 	LOG(INFO) << " ---Communication_socket_base::communication_bind() bind::  "<< bind_string << "  " << this;
 
@@ -132,12 +154,21 @@ Error_manager Communication_socket_base::communication_connect(std::string conne
 	Error_manager t_error;
 	int t_socket_result;
 	//m_socket 和远端通信, 连接远端服务器的端口
-	t_socket_result = m_socket.connect(connect_string);
-	if ( t_socket_result <0 )
+//	t_socket_result = m_socket.connect(connect_string);
+//	if ( t_socket_result <0 )
+//	{
+//		return Error_manager(Error_code::COMMUNICATION_CONNECT_ERROR, Error_level::MINOR_ERROR,
+//							 " m_socket.connect error ");
+//	}
+
+	//m_socket 和远端通信, 连接远端服务器的端口
+	int t_result = nng_dial( m_socket_bus, connect_string.c_str(), nullptr, NNG_FLAG_NONBLOCK );
+	if ( t_result != 0 )
 	{
 		return Error_manager(Error_code::COMMUNICATION_CONNECT_ERROR, Error_level::MINOR_ERROR,
-							 " m_socket.connect error ");
+							 "communication_connect nng_dial error ");
 	}
+
 	LOG(INFO) << " ---Communication_socket_base::communication_connect() connect::  "<< connect_string << "  " << this;
 
 	return Error_code::SUCCESS;
@@ -219,7 +250,8 @@ Error_manager Communication_socket_base::communication_uninit()
 	m_send_data_list.clear_and_delete();
 
 	m_communication_statu = COMMUNICATION_UNKNOW;
-	m_socket.close();
+	//m_socket.close();
+	nng_close(m_socket_bus);
 
 	return Error_code::SUCCESS;
 }
@@ -235,7 +267,30 @@ void Communication_socket_base::set_encapsulate_cycle_time(unsigned int encapsul
 }
 
 
-
+//接受string, 非阻塞模式,    return 接收数据,如果没有收到数据,长度就为0, 非阻塞模式
+std::string Communication_socket_base::receive_string()
+{
+	char* tp_data = NULL;
+	size_t t_size = 0;
+	int t_result = nng_recv(m_socket_bus,&tp_data,&t_size,NNG_FLAG_ALLOC | NNG_FLAG_NONBLOCK );
+	if( t_result != 0 ) {
+		return std::string();
+	}
+	else if ( t_size == 0 )
+	{
+		return std::string();
+	}
+	else
+	{
+		return std::string(tp_data, t_size);
+	}
+}
+//发送string
+void Communication_socket_base::send_string(std::string str)
+{
+	int t_result = nng_send(m_socket_bus,(void*)(str.c_str()), str.size(), NNG_FLAG_NONBLOCK);
+	return;
+}
 
 //mp_receive_data_thread 接受线程执行函数,
 //receive_data_thread 内部线程负责接受消息
@@ -255,10 +310,13 @@ void Communication_socket_base::receive_data_thread()
 			{//这个大括号表示只对 recv 和 send 加锁, 不要因为后面的复杂逻辑影响通信效率
 				std::unique_lock<std::mutex> lk(m_mutex);
 				//flags为1, 非阻塞接受消息, 如果接收到消息, 那么接受数据长度大于0
-				t_receive_string = m_socket.recv<std::string>(1);
+//				t_receive_string = m_socket.recv<std::string>(1);
+				t_receive_string = receive_string();
 			}
 			if ( t_receive_string.size()>0 )
 			{
+//				std::cout << " huli test :::: " << " t_receive_string = " << t_receive_string << std::endl;
+
 				//如果这里接受到了消息, 在这提前解析消息最前面的Base_msg (消息公共内容), 用于后续的check
 				message::Base_msg t_base_msg;
 				if( t_base_msg.ParseFromString(t_receive_string) )
@@ -498,7 +556,8 @@ void Communication_socket_base::send_data_thread()
 				{
 					{//这个大括号表示只对 recv 和 send 加锁, 不要因为后面的复杂逻辑影响通信效率
 						std::unique_lock<std::mutex> lk(m_mutex);
-						m_socket.send(tp_msg->get_message_buf());
+//						m_socket.send(tp_msg->get_message_buf());
+						send_string(tp_msg->get_message_buf());
 					}
 					delete(tp_msg);
 					tp_msg = NULL;

+ 10 - 1
communication/communication_socket_base.h

@@ -20,6 +20,9 @@
 #include <nnxx/socket.h>
 #include <nnxx/bus.h>
 
+#include <nng/nng.h>
+#include <nng/protocol/bus0/bus.h>
+
 #include <glog/logging.h>
 #include "../error_code/error_code.h"
 #include "../tool/binary_buf.h"
@@ -83,6 +86,11 @@ public://get or set member variable
 	void set_encapsulate_cycle_time(unsigned int encapsulate_cycle_time);
 
 protected:
+	//接受string, 非阻塞模式,    return 接收数据,如果没有收到数据,长度就为0, 非阻塞模式
+	std::string receive_string();
+	//发送string
+	void send_string(std::string str);
+
 	//mp_receive_data_thread 接受线程执行函数,
 	//receive_data_thread 内部线程负责接受消息
 	void receive_data_thread();
@@ -123,7 +131,8 @@ public:
 protected://member variable
 
 	//通用的网络编程接口, 默认使用总线模式, (网状结构)
-	nnxx::socket 						m_socket { nnxx::SP, nnxx::BUS };
+//	nnxx::socket 						m_socket { nnxx::SP, nnxx::BUS };
+	nng_socket 							m_socket_bus;//新版nng的通信socket
 	std::mutex 							m_mutex;				//m_socket的锁
 
 	//通信状态

+ 4 - 2
error_code/error_code.h

@@ -412,8 +412,10 @@ enum Error_code
 	COMMUNICATION_CONNECT_ERROR,
 	COMMUNICATION_ANALYSIS_TIME_OUT,									//解析超时,
 	COMMUNICATION_EXCUTER_IS_BUSY,										//处理器正忙, 请稍等
-
-
+	COMMUNICATION_INIT_ERROR,
+	COMMUNICATION_UNINIT_ERROR,
+	COMMUNICATION_RECEIVE_ERROR,
+	COMMUNICATION_SEND_ERROR,
 
 
 	//system module, 系统模块

+ 178 - 59
message/parkspace_allocation_message.pb.cc

@@ -343,6 +343,7 @@ void InitDefaultsParkspace_confirm_alloc_request_msgImpl() {
 #endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
   protobuf_message_5fbase_2eproto::InitDefaultsBase_info();
   protobuf_message_5fbase_2eproto::InitDefaultsParkspace_info();
+  protobuf_message_5fbase_2eproto::InitDefaultsLocate_information();
   {
     void* ptr = &::message::_Parkspace_confirm_alloc_request_msg_default_instance_;
     new (ptr) ::message::Parkspace_confirm_alloc_request_msg();
@@ -367,6 +368,7 @@ void InitDefaultsParkspace_confirm_alloc_response_msgImpl() {
   protobuf_message_5fbase_2eproto::InitDefaultsBase_info();
   protobuf_message_5fbase_2eproto::InitDefaultsError_manager();
   protobuf_message_5fbase_2eproto::InitDefaultsParkspace_info();
+  protobuf_message_5fbase_2eproto::InitDefaultsLocate_information();
   {
     void* ptr = &::message::_Parkspace_confirm_alloc_response_msg_default_instance_;
     new (ptr) ::message::Parkspace_confirm_alloc_response_msg();
@@ -586,9 +588,11 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUT
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Parkspace_confirm_alloc_request_msg, command_key_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Parkspace_confirm_alloc_request_msg, confirm_parkspace_info_ex_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Parkspace_confirm_alloc_request_msg, car_type_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Parkspace_confirm_alloc_request_msg, locate_information_),
   1,
   0,
   ~0u,
+  3,
   2,
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Parkspace_confirm_alloc_response_msg, _has_bits_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Parkspace_confirm_alloc_response_msg, _internal_metadata_),
@@ -600,10 +604,12 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUT
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Parkspace_confirm_alloc_response_msg, error_manager_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Parkspace_confirm_alloc_response_msg, confirm_parkspace_info_ex_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Parkspace_confirm_alloc_response_msg, car_type_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Parkspace_confirm_alloc_response_msg, locate_information_),
   1,
   0,
   2,
   ~0u,
+  4,
   3,
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Parkspace_allocation_status_msg, _has_bits_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Parkspace_allocation_status_msg, _internal_metadata_),
@@ -658,11 +664,11 @@ static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROT
   { 87, 96, sizeof(::message::Parkspace_release_response_msg)},
   { 100, 108, sizeof(::message::Parkspace_force_update_request_msg)},
   { 111, 120, sizeof(::message::Parkspace_force_update_response_msg)},
-  { 124, 133, sizeof(::message::Parkspace_confirm_alloc_request_msg)},
-  { 137, 147, sizeof(::message::Parkspace_confirm_alloc_response_msg)},
-  { 152, 166, sizeof(::message::Parkspace_allocation_status_msg)},
-  { 175, 181, sizeof(::message::Parkspace_refresh_request_msg)},
-  { 182, 190, sizeof(::message::Parkspace_allocation_data_msg)},
+  { 124, 134, sizeof(::message::Parkspace_confirm_alloc_request_msg)},
+  { 139, 150, sizeof(::message::Parkspace_confirm_alloc_response_msg)},
+  { 156, 170, sizeof(::message::Parkspace_allocation_status_msg)},
+  { 179, 185, sizeof(::message::Parkspace_refresh_request_msg)},
+  { 186, 194, sizeof(::message::Parkspace_allocation_data_msg)},
 };
 
 static ::google::protobuf::Message const * const file_default_instances[] = {
@@ -751,48 +757,51 @@ void AddDescriptorsImpl() {
       "\030\001 \002(\0132\022.message.Base_info\022\023\n\013command_ke"
       "y\030\002 \002(\t\022-\n\rerror_manager\030\003 \002(\0132\026.message"
       ".Error_manager\0229\n\030manual_parkspace_info_"
-      "ex\030\004 \003(\0132\027.message.Parkspace_info\"\302\001\n#Pa"
+      "ex\030\004 \003(\0132\027.message.Parkspace_info\"\373\001\n#Pa"
       "rkspace_confirm_alloc_request_msg\022%\n\tbas"
       "e_info\030\001 \002(\0132\022.message.Base_info\022\023\n\013comm"
       "and_key\030\002 \002(\t\022:\n\031confirm_parkspace_info_"
       "ex\030\003 \003(\0132\027.message.Parkspace_info\022#\n\010car"
-      "_type\030\004 \001(\0162\021.message.Car_type\"\362\001\n$Parks"
-      "pace_confirm_alloc_response_msg\022%\n\tbase_"
-      "info\030\001 \002(\0132\022.message.Base_info\022\023\n\013comman"
-      "d_key\030\002 \002(\t\022-\n\rerror_manager\030\003 \002(\0132\026.mes"
-      "sage.Error_manager\022:\n\031confirm_parkspace_"
-      "info_ex\030\004 \003(\0132\027.message.Parkspace_info\022#"
-      "\n\010car_type\030\005 \001(\0162\021.message.Car_type\"\275\003\n\037"
-      "Parkspace_allocation_status_msg\022%\n\tbase_"
-      "info\030\001 \002(\0132\022.message.Base_info\022-\n\rerror_"
-      "manager\030\002 \002(\0132\026.message.Error_manager\022G\n"
-      "\032database_controller_status\030\003 \002(\0162#.mess"
-      "age.Database_controller_status\022A\n\027parksp"
-      "ace_manager_satus\030\004 \002(\0162 .message.Parksp"
-      "ace_manager_satus\022\017\n\007unit_id\030\005 \002(\005\022(\n sm"
-      "all_parkspace_remaining_number\030\006 \002(\005\022)\n!"
-      "medium_parkspace_remaining_number\030\007 \002(\005\022"
-      "(\n large_parkspace_remaining_number\030\010 \002("
-      "\005\022(\n total_parkspace_remaining_number\030\t "
-      "\002(\005\"F\n\035Parkspace_refresh_request_msg\022%\n\t"
-      "base_info\030\001 \002(\0132\022.message.Base_info\"\251\001\n\035"
-      "Parkspace_allocation_data_msg\022%\n\tbase_in"
-      "fo\030\001 \002(\0132\022.message.Base_info\022-\n\rerror_ma"
-      "nager\030\002 \002(\0132\026.message.Error_manager\0222\n\021p"
-      "arkspace_info_ex\030\003 \003(\0132\027.message.Parkspa"
-      "ce_info*\225\001\n\016Vehicle_status\022\024\n\020eVehicle_u"
-      "nknown\020\000\022\021\n\reVehicle_idle\020\001\022\026\n\022eVehicle_"
-      "in_garage\020\002\022\024\n\020eVehicle_parking\020\003\022\025\n\021eVe"
-      "hicle_fetching\020\004\022\025\n\021eVehicle_reserved\020\005*"
-      "W\n\032Database_controller_status\022\r\n\tE_UNKNO"
-      "WN\020\000\022\013\n\007E_READY\020\001\022\020\n\014E_DISCONNECT\020\002\022\013\n\007E"
-      "_FAULT\020\003*v\n\027Parkspace_manager_satus\022\036\n\032e"
-      "Parkspace_manager_unknown\020\000\022\035\n\031eParkspac"
-      "e_manager_normal\020\001\022\034\n\030eParkspace_manager"
-      "_fault\020\002"
+      "_type\030\004 \001(\0162\021.message.Car_type\0227\n\022locate"
+      "_information\030\005 \001(\0132\033.message.Locate_info"
+      "rmation\"\253\002\n$Parkspace_confirm_alloc_resp"
+      "onse_msg\022%\n\tbase_info\030\001 \002(\0132\022.message.Ba"
+      "se_info\022\023\n\013command_key\030\002 \002(\t\022-\n\rerror_ma"
+      "nager\030\003 \002(\0132\026.message.Error_manager\022:\n\031c"
+      "onfirm_parkspace_info_ex\030\004 \003(\0132\027.message"
+      ".Parkspace_info\022#\n\010car_type\030\005 \001(\0162\021.mess"
+      "age.Car_type\0227\n\022locate_information\030\006 \001(\013"
+      "2\033.message.Locate_information\"\275\003\n\037Parksp"
+      "ace_allocation_status_msg\022%\n\tbase_info\030\001"
+      " \002(\0132\022.message.Base_info\022-\n\rerror_manage"
+      "r\030\002 \002(\0132\026.message.Error_manager\022G\n\032datab"
+      "ase_controller_status\030\003 \002(\0162#.message.Da"
+      "tabase_controller_status\022A\n\027parkspace_ma"
+      "nager_satus\030\004 \002(\0162 .message.Parkspace_ma"
+      "nager_satus\022\017\n\007unit_id\030\005 \002(\005\022(\n small_pa"
+      "rkspace_remaining_number\030\006 \002(\005\022)\n!medium"
+      "_parkspace_remaining_number\030\007 \002(\005\022(\n lar"
+      "ge_parkspace_remaining_number\030\010 \002(\005\022(\n t"
+      "otal_parkspace_remaining_number\030\t \002(\005\"F\n"
+      "\035Parkspace_refresh_request_msg\022%\n\tbase_i"
+      "nfo\030\001 \002(\0132\022.message.Base_info\"\251\001\n\035Parksp"
+      "ace_allocation_data_msg\022%\n\tbase_info\030\001 \002"
+      "(\0132\022.message.Base_info\022-\n\rerror_manager\030"
+      "\002 \002(\0132\026.message.Error_manager\0222\n\021parkspa"
+      "ce_info_ex\030\003 \003(\0132\027.message.Parkspace_inf"
+      "o*\225\001\n\016Vehicle_status\022\024\n\020eVehicle_unknown"
+      "\020\000\022\021\n\reVehicle_idle\020\001\022\026\n\022eVehicle_in_gar"
+      "age\020\002\022\024\n\020eVehicle_parking\020\003\022\025\n\021eVehicle_"
+      "fetching\020\004\022\025\n\021eVehicle_reserved\020\005*W\n\032Dat"
+      "abase_controller_status\022\r\n\tE_UNKNOWN\020\000\022\013"
+      "\n\007E_READY\020\001\022\020\n\014E_DISCONNECT\020\002\022\013\n\007E_FAULT"
+      "\020\003*v\n\027Parkspace_manager_satus\022\036\n\032eParksp"
+      "ace_manager_unknown\020\000\022\035\n\031eParkspace_mana"
+      "ger_normal\020\001\022\034\n\030eParkspace_manager_fault"
+      "\020\002"
   };
   ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
-      descriptor, 3368);
+      descriptor, 3482);
   ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
     "parkspace_allocation_message.proto", &protobuf_RegisterTypes);
   ::protobuf_message_5fbase_2eproto::AddDescriptors();
@@ -5259,6 +5268,8 @@ void Parkspace_force_update_response_msg::InternalSwap(Parkspace_force_update_re
 void Parkspace_confirm_alloc_request_msg::InitAsDefaultInstance() {
   ::message::_Parkspace_confirm_alloc_request_msg_default_instance_._instance.get_mutable()->base_info_ = const_cast< ::message::Base_info*>(
       ::message::Base_info::internal_default_instance());
+  ::message::_Parkspace_confirm_alloc_request_msg_default_instance_._instance.get_mutable()->locate_information_ = const_cast< ::message::Locate_information*>(
+      ::message::Locate_information::internal_default_instance());
 }
 void Parkspace_confirm_alloc_request_msg::clear_base_info() {
   if (base_info_ != NULL) base_info_->Clear();
@@ -5267,11 +5278,16 @@ void Parkspace_confirm_alloc_request_msg::clear_base_info() {
 void Parkspace_confirm_alloc_request_msg::clear_confirm_parkspace_info_ex() {
   confirm_parkspace_info_ex_.Clear();
 }
+void Parkspace_confirm_alloc_request_msg::clear_locate_information() {
+  if (locate_information_ != NULL) locate_information_->Clear();
+  clear_has_locate_information();
+}
 #if !defined(_MSC_VER) || _MSC_VER >= 1900
 const int Parkspace_confirm_alloc_request_msg::kBaseInfoFieldNumber;
 const int Parkspace_confirm_alloc_request_msg::kCommandKeyFieldNumber;
 const int Parkspace_confirm_alloc_request_msg::kConfirmParkspaceInfoExFieldNumber;
 const int Parkspace_confirm_alloc_request_msg::kCarTypeFieldNumber;
+const int Parkspace_confirm_alloc_request_msg::kLocateInformationFieldNumber;
 #endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
 
 Parkspace_confirm_alloc_request_msg::Parkspace_confirm_alloc_request_msg()
@@ -5298,6 +5314,11 @@ Parkspace_confirm_alloc_request_msg::Parkspace_confirm_alloc_request_msg(const P
   } else {
     base_info_ = NULL;
   }
+  if (from.has_locate_information()) {
+    locate_information_ = new ::message::Locate_information(*from.locate_information_);
+  } else {
+    locate_information_ = NULL;
+  }
   car_type_ = from.car_type_;
   // @@protoc_insertion_point(copy_constructor:message.Parkspace_confirm_alloc_request_msg)
 }
@@ -5318,6 +5339,7 @@ Parkspace_confirm_alloc_request_msg::~Parkspace_confirm_alloc_request_msg() {
 void Parkspace_confirm_alloc_request_msg::SharedDtor() {
   command_key_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
   if (this != internal_default_instance()) delete base_info_;
+  if (this != internal_default_instance()) delete locate_information_;
 }
 
 void Parkspace_confirm_alloc_request_msg::SetCachedSize(int size) const {
@@ -5351,7 +5373,7 @@ void Parkspace_confirm_alloc_request_msg::Clear() {
 
   confirm_parkspace_info_ex_.Clear();
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 7u) {
     if (cached_has_bits & 0x00000001u) {
       GOOGLE_DCHECK(!command_key_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
       (*command_key_.UnsafeRawStringPointer())->clear();
@@ -5360,6 +5382,10 @@ void Parkspace_confirm_alloc_request_msg::Clear() {
       GOOGLE_DCHECK(base_info_ != NULL);
       base_info_->Clear();
     }
+    if (cached_has_bits & 0x00000004u) {
+      GOOGLE_DCHECK(locate_information_ != NULL);
+      locate_information_->Clear();
+    }
   }
   car_type_ = 0;
   _has_bits_.Clear();
@@ -5435,6 +5461,18 @@ bool Parkspace_confirm_alloc_request_msg::MergePartialFromCodedStream(
         break;
       }
 
+      // optional .message.Locate_information locate_information = 5;
+      case 5: {
+        if (static_cast< ::google::protobuf::uint8>(tag) ==
+            static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) {
+          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
+               input, mutable_locate_information()));
+        } else {
+          goto handle_unusual;
+        }
+        break;
+      }
+
       default: {
       handle_unusual:
         if (tag == 0) {
@@ -5486,11 +5524,17 @@ void Parkspace_confirm_alloc_request_msg::SerializeWithCachedSizes(
   }
 
   // optional .message.Car_type car_type = 4;
-  if (cached_has_bits & 0x00000004u) {
+  if (cached_has_bits & 0x00000008u) {
     ::google::protobuf::internal::WireFormatLite::WriteEnum(
       4, this->car_type(), output);
   }
 
+  // optional .message.Locate_information locate_information = 5;
+  if (cached_has_bits & 0x00000004u) {
+    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
+      5, *this->locate_information_, output);
+  }
+
   if (_internal_metadata_.have_unknown_fields()) {
     ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
         _internal_metadata_.unknown_fields(), output);
@@ -5533,11 +5577,18 @@ void Parkspace_confirm_alloc_request_msg::SerializeWithCachedSizes(
   }
 
   // optional .message.Car_type car_type = 4;
-  if (cached_has_bits & 0x00000004u) {
+  if (cached_has_bits & 0x00000008u) {
     target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
       4, this->car_type(), target);
   }
 
+  // optional .message.Locate_information locate_information = 5;
+  if (cached_has_bits & 0x00000004u) {
+    target = ::google::protobuf::internal::WireFormatLite::
+      InternalWriteMessageToArray(
+        5, *this->locate_information_, deterministic, target);
+  }
+
   if (_internal_metadata_.have_unknown_fields()) {
     target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
         _internal_metadata_.unknown_fields(), target);
@@ -5600,12 +5651,21 @@ size_t Parkspace_confirm_alloc_request_msg::ByteSizeLong() const {
     }
   }
 
-  // optional .message.Car_type car_type = 4;
-  if (has_car_type()) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::EnumSize(this->car_type());
-  }
+  if (_has_bits_[0 / 32] & 12u) {
+    // optional .message.Locate_information locate_information = 5;
+    if (has_locate_information()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::MessageSize(
+          *this->locate_information_);
+    }
 
+    // optional .message.Car_type car_type = 4;
+    if (has_car_type()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::EnumSize(this->car_type());
+    }
+
+  }
   int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
   GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
   _cached_size_ = cached_size;
@@ -5637,7 +5697,7 @@ void Parkspace_confirm_alloc_request_msg::MergeFrom(const Parkspace_confirm_allo
 
   confirm_parkspace_info_ex_.MergeFrom(from.confirm_parkspace_info_ex_);
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 7u) {
+  if (cached_has_bits & 15u) {
     if (cached_has_bits & 0x00000001u) {
       set_has_command_key();
       command_key_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.command_key_);
@@ -5646,6 +5706,9 @@ void Parkspace_confirm_alloc_request_msg::MergeFrom(const Parkspace_confirm_allo
       mutable_base_info()->::message::Base_info::MergeFrom(from.base_info());
     }
     if (cached_has_bits & 0x00000004u) {
+      mutable_locate_information()->::message::Locate_information::MergeFrom(from.locate_information());
+    }
+    if (cached_has_bits & 0x00000008u) {
       car_type_ = from.car_type_;
     }
     _has_bits_[0] |= cached_has_bits;
@@ -5683,6 +5746,7 @@ void Parkspace_confirm_alloc_request_msg::InternalSwap(Parkspace_confirm_alloc_r
   confirm_parkspace_info_ex_.InternalSwap(&other->confirm_parkspace_info_ex_);
   command_key_.Swap(&other->command_key_);
   swap(base_info_, other->base_info_);
+  swap(locate_information_, other->locate_information_);
   swap(car_type_, other->car_type_);
   swap(_has_bits_[0], other->_has_bits_[0]);
   _internal_metadata_.Swap(&other->_internal_metadata_);
@@ -5702,6 +5766,8 @@ void Parkspace_confirm_alloc_response_msg::InitAsDefaultInstance() {
       ::message::Base_info::internal_default_instance());
   ::message::_Parkspace_confirm_alloc_response_msg_default_instance_._instance.get_mutable()->error_manager_ = const_cast< ::message::Error_manager*>(
       ::message::Error_manager::internal_default_instance());
+  ::message::_Parkspace_confirm_alloc_response_msg_default_instance_._instance.get_mutable()->locate_information_ = const_cast< ::message::Locate_information*>(
+      ::message::Locate_information::internal_default_instance());
 }
 void Parkspace_confirm_alloc_response_msg::clear_base_info() {
   if (base_info_ != NULL) base_info_->Clear();
@@ -5714,12 +5780,17 @@ void Parkspace_confirm_alloc_response_msg::clear_error_manager() {
 void Parkspace_confirm_alloc_response_msg::clear_confirm_parkspace_info_ex() {
   confirm_parkspace_info_ex_.Clear();
 }
+void Parkspace_confirm_alloc_response_msg::clear_locate_information() {
+  if (locate_information_ != NULL) locate_information_->Clear();
+  clear_has_locate_information();
+}
 #if !defined(_MSC_VER) || _MSC_VER >= 1900
 const int Parkspace_confirm_alloc_response_msg::kBaseInfoFieldNumber;
 const int Parkspace_confirm_alloc_response_msg::kCommandKeyFieldNumber;
 const int Parkspace_confirm_alloc_response_msg::kErrorManagerFieldNumber;
 const int Parkspace_confirm_alloc_response_msg::kConfirmParkspaceInfoExFieldNumber;
 const int Parkspace_confirm_alloc_response_msg::kCarTypeFieldNumber;
+const int Parkspace_confirm_alloc_response_msg::kLocateInformationFieldNumber;
 #endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
 
 Parkspace_confirm_alloc_response_msg::Parkspace_confirm_alloc_response_msg()
@@ -5751,6 +5822,11 @@ Parkspace_confirm_alloc_response_msg::Parkspace_confirm_alloc_response_msg(const
   } else {
     error_manager_ = NULL;
   }
+  if (from.has_locate_information()) {
+    locate_information_ = new ::message::Locate_information(*from.locate_information_);
+  } else {
+    locate_information_ = NULL;
+  }
   car_type_ = from.car_type_;
   // @@protoc_insertion_point(copy_constructor:message.Parkspace_confirm_alloc_response_msg)
 }
@@ -5772,6 +5848,7 @@ void Parkspace_confirm_alloc_response_msg::SharedDtor() {
   command_key_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
   if (this != internal_default_instance()) delete base_info_;
   if (this != internal_default_instance()) delete error_manager_;
+  if (this != internal_default_instance()) delete locate_information_;
 }
 
 void Parkspace_confirm_alloc_response_msg::SetCachedSize(int size) const {
@@ -5805,7 +5882,7 @@ void Parkspace_confirm_alloc_response_msg::Clear() {
 
   confirm_parkspace_info_ex_.Clear();
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 7u) {
+  if (cached_has_bits & 15u) {
     if (cached_has_bits & 0x00000001u) {
       GOOGLE_DCHECK(!command_key_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
       (*command_key_.UnsafeRawStringPointer())->clear();
@@ -5818,6 +5895,10 @@ void Parkspace_confirm_alloc_response_msg::Clear() {
       GOOGLE_DCHECK(error_manager_ != NULL);
       error_manager_->Clear();
     }
+    if (cached_has_bits & 0x00000008u) {
+      GOOGLE_DCHECK(locate_information_ != NULL);
+      locate_information_->Clear();
+    }
   }
   car_type_ = 0;
   _has_bits_.Clear();
@@ -5905,6 +5986,18 @@ bool Parkspace_confirm_alloc_response_msg::MergePartialFromCodedStream(
         break;
       }
 
+      // optional .message.Locate_information locate_information = 6;
+      case 6: {
+        if (static_cast< ::google::protobuf::uint8>(tag) ==
+            static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) {
+          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
+               input, mutable_locate_information()));
+        } else {
+          goto handle_unusual;
+        }
+        break;
+      }
+
       default: {
       handle_unusual:
         if (tag == 0) {
@@ -5962,11 +6055,17 @@ void Parkspace_confirm_alloc_response_msg::SerializeWithCachedSizes(
   }
 
   // optional .message.Car_type car_type = 5;
-  if (cached_has_bits & 0x00000008u) {
+  if (cached_has_bits & 0x00000010u) {
     ::google::protobuf::internal::WireFormatLite::WriteEnum(
       5, this->car_type(), output);
   }
 
+  // optional .message.Locate_information locate_information = 6;
+  if (cached_has_bits & 0x00000008u) {
+    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
+      6, *this->locate_information_, output);
+  }
+
   if (_internal_metadata_.have_unknown_fields()) {
     ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
         _internal_metadata_.unknown_fields(), output);
@@ -6016,11 +6115,18 @@ void Parkspace_confirm_alloc_response_msg::SerializeWithCachedSizes(
   }
 
   // optional .message.Car_type car_type = 5;
-  if (cached_has_bits & 0x00000008u) {
+  if (cached_has_bits & 0x00000010u) {
     target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
       5, this->car_type(), target);
   }
 
+  // optional .message.Locate_information locate_information = 6;
+  if (cached_has_bits & 0x00000008u) {
+    target = ::google::protobuf::internal::WireFormatLite::
+      InternalWriteMessageToArray(
+        6, *this->locate_information_, deterministic, target);
+  }
+
   if (_internal_metadata_.have_unknown_fields()) {
     target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
         _internal_metadata_.unknown_fields(), target);
@@ -6095,12 +6201,21 @@ size_t Parkspace_confirm_alloc_response_msg::ByteSizeLong() const {
     }
   }
 
-  // optional .message.Car_type car_type = 5;
-  if (has_car_type()) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::EnumSize(this->car_type());
-  }
+  if (_has_bits_[0 / 32] & 24u) {
+    // optional .message.Locate_information locate_information = 6;
+    if (has_locate_information()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::MessageSize(
+          *this->locate_information_);
+    }
+
+    // optional .message.Car_type car_type = 5;
+    if (has_car_type()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::EnumSize(this->car_type());
+    }
 
+  }
   int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
   GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
   _cached_size_ = cached_size;
@@ -6132,7 +6247,7 @@ void Parkspace_confirm_alloc_response_msg::MergeFrom(const Parkspace_confirm_all
 
   confirm_parkspace_info_ex_.MergeFrom(from.confirm_parkspace_info_ex_);
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 15u) {
+  if (cached_has_bits & 31u) {
     if (cached_has_bits & 0x00000001u) {
       set_has_command_key();
       command_key_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.command_key_);
@@ -6144,6 +6259,9 @@ void Parkspace_confirm_alloc_response_msg::MergeFrom(const Parkspace_confirm_all
       mutable_error_manager()->::message::Error_manager::MergeFrom(from.error_manager());
     }
     if (cached_has_bits & 0x00000008u) {
+      mutable_locate_information()->::message::Locate_information::MergeFrom(from.locate_information());
+    }
+    if (cached_has_bits & 0x00000010u) {
       car_type_ = from.car_type_;
     }
     _has_bits_[0] |= cached_has_bits;
@@ -6185,6 +6303,7 @@ void Parkspace_confirm_alloc_response_msg::InternalSwap(Parkspace_confirm_alloc_
   command_key_.Swap(&other->command_key_);
   swap(base_info_, other->base_info_);
   swap(error_manager_, other->error_manager_);
+  swap(locate_information_, other->locate_information_);
   swap(car_type_, other->car_type_);
   swap(_has_bits_[0], other->_has_bits_[0]);
   _internal_metadata_.Swap(&other->_internal_metadata_);

+ 130 - 6
message/parkspace_allocation_message.pb.h

@@ -1871,6 +1871,15 @@ class Parkspace_confirm_alloc_request_msg : public ::google::protobuf::Message /
   ::message::Base_info* mutable_base_info();
   void set_allocated_base_info(::message::Base_info* base_info);
 
+  // optional .message.Locate_information locate_information = 5;
+  bool has_locate_information() const;
+  void clear_locate_information();
+  static const int kLocateInformationFieldNumber = 5;
+  const ::message::Locate_information& locate_information() const;
+  ::message::Locate_information* release_locate_information();
+  ::message::Locate_information* mutable_locate_information();
+  void set_allocated_locate_information(::message::Locate_information* locate_information);
+
   // optional .message.Car_type car_type = 4;
   bool has_car_type() const;
   void clear_car_type();
@@ -1886,6 +1895,8 @@ class Parkspace_confirm_alloc_request_msg : public ::google::protobuf::Message /
   void clear_has_command_key();
   void set_has_car_type();
   void clear_has_car_type();
+  void set_has_locate_information();
+  void clear_has_locate_information();
 
   // helper for ByteSizeLong()
   size_t RequiredFieldsByteSizeFallback() const;
@@ -1896,6 +1907,7 @@ class Parkspace_confirm_alloc_request_msg : public ::google::protobuf::Message /
   ::google::protobuf::RepeatedPtrField< ::message::Parkspace_info > confirm_parkspace_info_ex_;
   ::google::protobuf::internal::ArenaStringPtr command_key_;
   ::message::Base_info* base_info_;
+  ::message::Locate_information* locate_information_;
   int car_type_;
   friend struct ::protobuf_parkspace_5fallocation_5fmessage_2eproto::TableStruct;
   friend void ::protobuf_parkspace_5fallocation_5fmessage_2eproto::InitDefaultsParkspace_confirm_alloc_request_msgImpl();
@@ -2036,6 +2048,15 @@ class Parkspace_confirm_alloc_response_msg : public ::google::protobuf::Message
   ::message::Error_manager* mutable_error_manager();
   void set_allocated_error_manager(::message::Error_manager* error_manager);
 
+  // optional .message.Locate_information locate_information = 6;
+  bool has_locate_information() const;
+  void clear_locate_information();
+  static const int kLocateInformationFieldNumber = 6;
+  const ::message::Locate_information& locate_information() const;
+  ::message::Locate_information* release_locate_information();
+  ::message::Locate_information* mutable_locate_information();
+  void set_allocated_locate_information(::message::Locate_information* locate_information);
+
   // optional .message.Car_type car_type = 5;
   bool has_car_type() const;
   void clear_car_type();
@@ -2053,6 +2074,8 @@ class Parkspace_confirm_alloc_response_msg : public ::google::protobuf::Message
   void clear_has_error_manager();
   void set_has_car_type();
   void clear_has_car_type();
+  void set_has_locate_information();
+  void clear_has_locate_information();
 
   // helper for ByteSizeLong()
   size_t RequiredFieldsByteSizeFallback() const;
@@ -2064,6 +2087,7 @@ class Parkspace_confirm_alloc_response_msg : public ::google::protobuf::Message
   ::google::protobuf::internal::ArenaStringPtr command_key_;
   ::message::Base_info* base_info_;
   ::message::Error_manager* error_manager_;
+  ::message::Locate_information* locate_information_;
   int car_type_;
   friend struct ::protobuf_parkspace_5fallocation_5fmessage_2eproto::TableStruct;
   friend void ::protobuf_parkspace_5fallocation_5fmessage_2eproto::InitDefaultsParkspace_confirm_alloc_response_msgImpl();
@@ -4504,13 +4528,13 @@ Parkspace_confirm_alloc_request_msg::confirm_parkspace_info_ex() const {
 
 // optional .message.Car_type car_type = 4;
 inline bool Parkspace_confirm_alloc_request_msg::has_car_type() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
+  return (_has_bits_[0] & 0x00000008u) != 0;
 }
 inline void Parkspace_confirm_alloc_request_msg::set_has_car_type() {
-  _has_bits_[0] |= 0x00000004u;
+  _has_bits_[0] |= 0x00000008u;
 }
 inline void Parkspace_confirm_alloc_request_msg::clear_has_car_type() {
-  _has_bits_[0] &= ~0x00000004u;
+  _has_bits_[0] &= ~0x00000008u;
 }
 inline void Parkspace_confirm_alloc_request_msg::clear_car_type() {
   car_type_ = 0;
@@ -4527,6 +4551,56 @@ inline void Parkspace_confirm_alloc_request_msg::set_car_type(::message::Car_typ
   // @@protoc_insertion_point(field_set:message.Parkspace_confirm_alloc_request_msg.car_type)
 }
 
+// optional .message.Locate_information locate_information = 5;
+inline bool Parkspace_confirm_alloc_request_msg::has_locate_information() const {
+  return (_has_bits_[0] & 0x00000004u) != 0;
+}
+inline void Parkspace_confirm_alloc_request_msg::set_has_locate_information() {
+  _has_bits_[0] |= 0x00000004u;
+}
+inline void Parkspace_confirm_alloc_request_msg::clear_has_locate_information() {
+  _has_bits_[0] &= ~0x00000004u;
+}
+inline const ::message::Locate_information& Parkspace_confirm_alloc_request_msg::locate_information() const {
+  const ::message::Locate_information* p = locate_information_;
+  // @@protoc_insertion_point(field_get:message.Parkspace_confirm_alloc_request_msg.locate_information)
+  return p != NULL ? *p : *reinterpret_cast<const ::message::Locate_information*>(
+      &::message::_Locate_information_default_instance_);
+}
+inline ::message::Locate_information* Parkspace_confirm_alloc_request_msg::release_locate_information() {
+  // @@protoc_insertion_point(field_release:message.Parkspace_confirm_alloc_request_msg.locate_information)
+  clear_has_locate_information();
+  ::message::Locate_information* temp = locate_information_;
+  locate_information_ = NULL;
+  return temp;
+}
+inline ::message::Locate_information* Parkspace_confirm_alloc_request_msg::mutable_locate_information() {
+  set_has_locate_information();
+  if (locate_information_ == NULL) {
+    locate_information_ = new ::message::Locate_information;
+  }
+  // @@protoc_insertion_point(field_mutable:message.Parkspace_confirm_alloc_request_msg.locate_information)
+  return locate_information_;
+}
+inline void Parkspace_confirm_alloc_request_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_);
+  }
+  if (locate_information) {
+    ::google::protobuf::Arena* submessage_arena = NULL;
+    if (message_arena != submessage_arena) {
+      locate_information = ::google::protobuf::internal::GetOwnedMessage(
+          message_arena, locate_information, submessage_arena);
+    }
+    set_has_locate_information();
+  } else {
+    clear_has_locate_information();
+  }
+  locate_information_ = locate_information;
+  // @@protoc_insertion_point(field_set_allocated:message.Parkspace_confirm_alloc_request_msg.locate_information)
+}
+
 // -------------------------------------------------------------------
 
 // Parkspace_confirm_alloc_response_msg
@@ -4723,13 +4797,13 @@ Parkspace_confirm_alloc_response_msg::confirm_parkspace_info_ex() const {
 
 // optional .message.Car_type car_type = 5;
 inline bool Parkspace_confirm_alloc_response_msg::has_car_type() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
+  return (_has_bits_[0] & 0x00000010u) != 0;
 }
 inline void Parkspace_confirm_alloc_response_msg::set_has_car_type() {
-  _has_bits_[0] |= 0x00000008u;
+  _has_bits_[0] |= 0x00000010u;
 }
 inline void Parkspace_confirm_alloc_response_msg::clear_has_car_type() {
-  _has_bits_[0] &= ~0x00000008u;
+  _has_bits_[0] &= ~0x00000010u;
 }
 inline void Parkspace_confirm_alloc_response_msg::clear_car_type() {
   car_type_ = 0;
@@ -4746,6 +4820,56 @@ inline void Parkspace_confirm_alloc_response_msg::set_car_type(::message::Car_ty
   // @@protoc_insertion_point(field_set:message.Parkspace_confirm_alloc_response_msg.car_type)
 }
 
+// optional .message.Locate_information locate_information = 6;
+inline bool Parkspace_confirm_alloc_response_msg::has_locate_information() const {
+  return (_has_bits_[0] & 0x00000008u) != 0;
+}
+inline void Parkspace_confirm_alloc_response_msg::set_has_locate_information() {
+  _has_bits_[0] |= 0x00000008u;
+}
+inline void Parkspace_confirm_alloc_response_msg::clear_has_locate_information() {
+  _has_bits_[0] &= ~0x00000008u;
+}
+inline const ::message::Locate_information& Parkspace_confirm_alloc_response_msg::locate_information() const {
+  const ::message::Locate_information* p = locate_information_;
+  // @@protoc_insertion_point(field_get:message.Parkspace_confirm_alloc_response_msg.locate_information)
+  return p != NULL ? *p : *reinterpret_cast<const ::message::Locate_information*>(
+      &::message::_Locate_information_default_instance_);
+}
+inline ::message::Locate_information* Parkspace_confirm_alloc_response_msg::release_locate_information() {
+  // @@protoc_insertion_point(field_release:message.Parkspace_confirm_alloc_response_msg.locate_information)
+  clear_has_locate_information();
+  ::message::Locate_information* temp = locate_information_;
+  locate_information_ = NULL;
+  return temp;
+}
+inline ::message::Locate_information* Parkspace_confirm_alloc_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.Parkspace_confirm_alloc_response_msg.locate_information)
+  return locate_information_;
+}
+inline void Parkspace_confirm_alloc_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_);
+  }
+  if (locate_information) {
+    ::google::protobuf::Arena* submessage_arena = NULL;
+    if (message_arena != submessage_arena) {
+      locate_information = ::google::protobuf::internal::GetOwnedMessage(
+          message_arena, locate_information, submessage_arena);
+    }
+    set_has_locate_information();
+  } else {
+    clear_has_locate_information();
+  }
+  locate_information_ = locate_information;
+  // @@protoc_insertion_point(field_set_allocated:message.Parkspace_confirm_alloc_response_msg.locate_information)
+}
+
 // -------------------------------------------------------------------
 
 // Parkspace_allocation_status_msg

+ 2 - 0
message/parkspace_allocation_message.proto

@@ -129,6 +129,7 @@ message Parkspace_confirm_alloc_request_msg
     required string                     command_key=2;           //指令唯一标识符id
     repeated Parkspace_info             confirm_parkspace_info_ex = 3;    //分配车位信息
     optional Car_type                   car_type = 4;//汽车类型
+    optional Locate_information         locate_information = 5;  //测量信息
 
 }
 //确认分配车位反馈
@@ -139,6 +140,7 @@ message Parkspace_confirm_alloc_response_msg
     required Error_manager              error_manager=3;        //分配成功与否标志
     repeated Parkspace_info             confirm_parkspace_info_ex = 4;    //已修改后的车位信息
     optional Car_type                   car_type = 5;//汽车类型
+    optional Locate_information         locate_information = 6;  //测量信息
 
 }
 

+ 5 - 3
parkspace_allocation/parkspace_manager.cpp

@@ -450,6 +450,7 @@ void Parkspace_manager::execute_for_confirm_alloc(message::Parkspace_confirm_all
 	t_error.set_error_level(message::Error_level::NORMAL);
 	//确认的车位
 	message::Parkspace_info confirm_alloc_space_info;
+	message::Locate_information locate_information;
     LOG_IF(WARNING, request.confirm_parkspace_info_ex().size() <= 0) <<"confirm alloc space empty";
 	Error_manager error;
 
@@ -470,7 +471,8 @@ void Parkspace_manager::execute_for_confirm_alloc(message::Parkspace_confirm_all
 		{
 
             confirm_alloc_space_info.mutable_car_info()->CopyFrom(request.confirm_parkspace_info_ex(i).car_info());
-			error = confirm_alloc_function(confirm_alloc_space_info);
+			locate_information.CopyFrom(request.locate_information());
+			error = confirm_alloc_function(confirm_alloc_space_info,locate_information);
 			if ( error != SUCCESS )
 			{
 				t_error.set_error_code(error.get_error_code());
@@ -727,7 +729,7 @@ void Parkspace_manager::execute_for_force_update(message::Parkspace_force_update
 	send_parkspace_data();
 }
 //确认分配操作函数、
-Error_manager Parkspace_manager::confirm_alloc_function(message::Parkspace_info& t_confirm_space)
+Error_manager Parkspace_manager::confirm_alloc_function(message::Parkspace_info& t_confirm_space,message::Locate_information locate_information)
 {
 	//根据车位信息定位待确认占用车位
 	Error_manager error;
@@ -792,7 +794,7 @@ Error_manager Parkspace_manager::confirm_alloc_function(message::Parkspace_info&
 					t->tm_min,
 					t->tm_sec);
 			t_confirm_space.set_entry_time(my_time_buf);
-			error = m_parkspace_operating_function.insert_parking_record(t_confirm_space);
+			error = m_parkspace_operating_function.insert_parking_record(t_confirm_space,locate_information);
 			if ( error != SUCCESS )
 			{
 				LOG(WARNING) << "插入停车记录失败: " << error.to_string();

+ 1 - 1
parkspace_allocation/parkspace_manager.h

@@ -109,7 +109,7 @@ public://execute_msg创建各线程进行处理
 
 
     //确认分配操作函数
-	Error_manager confirm_alloc_function(message::Parkspace_info& confirm_alloc_space_info);
+	Error_manager confirm_alloc_function(message::Parkspace_info& confirm_alloc_space_info,message::Locate_information locate_information);
     //释放车位操作函数
 	Error_manager release_parkspace_function(message::Parkspace_info& release_space_info);
 

+ 12 - 4
parkspace_allocation/parkspace_operating_function.cpp

@@ -462,10 +462,10 @@ Error_manager Parkspace_operating_function::insert_vehicle_with_parkspace(messag
 }
 
 // 插入停车记录
-Error_manager Parkspace_operating_function::insert_parking_record(message::Parkspace_info parkspace_info)
+Error_manager Parkspace_operating_function::insert_parking_record(message::Parkspace_info parkspace_info,message::Locate_information locateInformation)
 {
 	//参数中必须包含车辆信息与车位编号
-	if(!parkspace_info.has_car_info() || parkspace_info.parkingspace_index_id() <= 0)
+	if(!parkspace_info.has_car_info() || parkspace_info.parkingspace_index_id() <= 0 || !locateInformation.has_locate_x())
 	{
 		return Error_manager(Error_code::PARAMETER_ERROR, Error_level::MINOR_ERROR,
 							 "参数错误 Parkspace_operating_function::insert_parking_record error ");
@@ -473,10 +473,18 @@ Error_manager Parkspace_operating_function::insert_parking_record(message::Parks
 	char insert_parking_record_sql[1024];
 	memset(insert_parking_record_sql, 0, 1024);
 	//将车辆号牌,车位ID,记录状态,停车与取车时间写入
-		sprintf(insert_parking_record_sql, "INSERT INTO parkingrecords (numberPlate,parkingSpaceID,realParkTime) values ('%s',%d,'%s')",
+		sprintf(insert_parking_record_sql, "INSERT INTO parkingrecords (numberPlate,parkingSpaceID,realParkTime,locateX,locateY,locateAngle,locateLength,locateWidth,locateHeigth,locateWheelBase,locateWheelWidth) values ('%s',%d,'%s',%.3f,%.3f,%.3f,%.3f,%.3f,%.3f,%.3f,%.3f)",
 				parkspace_info.car_info().license().c_str(),
 				parkspace_info.parkingspace_index_id(),
-				parkspace_info.entry_time().c_str());
+				parkspace_info.entry_time().c_str(),
+				locateInformation.locate_x(),
+				locateInformation.locate_y(),
+				locateInformation.locate_angle(),
+				locateInformation.locate_length(),
+				locateInformation.locate_width(),
+				locateInformation.locate_height(),
+				locateInformation.locate_wheel_base(),
+				locateInformation.locate_wheel_width());
 	Error_manager ec = Database_controller::get_instance_pointer()->sql_insert(insert_parking_record_sql);
 	return ec;
 

+ 1 - 1
parkspace_allocation/parkspace_operating_function.h

@@ -42,7 +42,7 @@ public:
     // 插入车辆
     Error_manager insert_vehicle_with_parkspace(message::Parkspace_info parkspace_info, message::Vehicle_status &vehicle_status);
     // 插入停车记录
-    Error_manager insert_parking_record(message::Parkspace_info parkspace_info);
+    Error_manager insert_parking_record(message::Parkspace_info parkspace_info,message::Locate_information locate_information);
     // 更新停车记录,待计费系统加入后完善!!!
     Error_manager update_parking_record(message::Parkspace_info parkspace_info, int record_id);
     // 根据车位编号查询车位

+ 1 - 0
proto.sh

@@ -2,3 +2,4 @@ protoc -I=./message message_base.proto --cpp_out=./message
 protoc -I=./message parkspace_allocation_message.proto --cpp_out=./message
 protoc -I=./parkspace_allocation database_communication_configuration.proto --cpp_out=./parkspace_allocation
 protoc -I=./communication communication.proto --cpp_out=./communication
+

+ 1 - 1
setting/communication.prototxt

@@ -8,7 +8,7 @@ communication_parameters
 #   connect_string_vector:"tcp://192.168.2.125:9876"
 #   connect_string_vector:"tcp://192.168.2.166:1234"
 
-    bind_string:"tcp://192.168.1.233:30008"
+    bind_string:"tcp://192.168.2.116:30008"
     connect_string_vector:"tcp://192.168.1.233:30000"
 }