Explorar o código

2020 10/27 数据库通信

wk %!s(int64=4) %!d(string=hai) anos
pai
achega
f8dfe9444b

+ 0 - 37
parkspace_allocation/parkspace_allocation_communicator.cpp

@@ -18,9 +18,6 @@ Error_manager Parkspace_allocation_communicator::send_response(Communication_mes
     return encapsulate_msg(message);
 }
 
-
-
-
 //************************************* 内部函数 ****************************************
 //封装反馈消息自动发送
 Error_manager Parkspace_allocation_communicator::encapsulate_msg(Communication_message *message)
@@ -115,43 +112,9 @@ Error_manager Parkspace_allocation_communicator::check_executer(Communication_me
 	}
 	return Error_code::SUCCESS;
 }
-
-class AAA
-{
-public:
-	message::Parkspace_allocation_status_msg mmm;
-
-	message::Parkspace_allocation_status_msg & get()
-	{
-		return mmm;
-	}
-};
-
-
 //重载心跳与车位状态发送函数
 Error_manager Parkspace_allocation_communicator::encapsulate_send_data()
 {
-//	AAA aaa;
-//	message::Parkspace_allocation_status_msg &     m_parkspace_status_msg3 = aaa.get();
-//	std::string str3;
-//	m_parkspace_status_msg3.SerializeToString(&str3);
-//
-//	return Error_code::SUCCESS;
-
-//	message::Parkspace_allocation_status_msg      m_parkspace_status_msg;
-//	Communication_socket_base::encapsulate_msg(m_parkspace_status_msg.SerializeAsString());
-//	return Error_code::SUCCESS;
-
-
-	Parkspace_allocator & parkspace_allocator = Parkspace_allocator::get_instance_references();
-	message::Parkspace_allocation_status_msg &     m_parkspace_status_msg2 = parkspace_allocator.get_parkspace_status_msg();
-	std::string str;
-	m_parkspace_status_msg2.SerializeToString(&str);
-//	Communication_socket_base::encapsulate_msg(str);
-return Error_code::SUCCESS;
-
-
-
     std::lock_guard<std::mutex> lck(Parkspace_allocator::get_instance_references().get_status_mutex());
 	Communication_socket_base::encapsulate_msg( Parkspace_allocator::get_instance_references().get_parkspace_status_msg().SerializeAsString() );
 	return Error_code::SUCCESS;

+ 2 - 0
parkspace_allocation/parkspace_allocator.cpp

@@ -250,6 +250,8 @@ bool Parkspace_allocator::check_car_existence(std::string license, message::Park
         {   
             return true;
         }
+
+
     }
     return false;
 }

+ 1 - 1
parkspace_allocation/parkspace_allocator.h

@@ -78,7 +78,7 @@ private://execute_msg创建各线程进行处理
     void execute_for_confirm_alloc(message::Parkspace_info space_info, message::Command_info command_info);
 
     // 分配车位函数
-    // input: 当前完整车位状态信息, 终端id, 
+    // input: 当前完整车位状态信息, 终端id,
     // output: 分配的车位下标
     int allocate_parkspace(message::Parkspace_allocation_status_msg parkspace_status, message::Car_info car_info, int terminal_id);
 

+ 1 - 1
test/parkspace_client.cpp

@@ -152,7 +152,7 @@ int main()
    sleep(1);
     int n = 0;
     message::Base_msg base_msg;
-    std::string alloc_req =send_release_request(1,"王wkwk21");
+    std::string alloc_req =send_confirm_request(25,"鄂wkwk1");
 	socket.send(alloc_req);
 //	alloc_req=send_search_requests("鄂WK2341");
 //