Bläddra i källkod

2021 0301, wangkang parkspace

wk 4 år sedan
förälder
incheckning
b464fbc6a9

+ 15 - 15
CMakeLists.txt

@@ -50,21 +50,21 @@ target_link_libraries(parkspace_test
         /usr/local/lib/libgflags.a
         libmysqlcppconn.so
         )
-#add_executable(parkspace_client
-#        ./test/parkspace_client.cpp
-#        ${error_src}
-#        ${message_src}
-#        ${TOOL_SRC}
-#        ${COMMUNICATION_SRC}
-#        )
-#target_link_libraries(parkspace_client
-#        nnxx
-#        nanomsg
-#        ${PROTOBUF_LIBRARIES}
-#        /usr/local/lib/libglog.a
-#        /usr/local/lib/libgflags.a
-#        )
-#
+add_executable(parkspace_client
+        ./test/parkspace_client.cpp
+        ${error_src}
+        ${message_src}
+        ${TOOL_SRC}
+        ${COMMUNICATION_SRC}
+        )
+target_link_libraries(parkspace_client
+        nnxx
+        nanomsg
+        ${PROTOBUF_LIBRARIES}
+        /usr/local/lib/libglog.a
+        /usr/local/lib/libgflags.a
+        )
+
 ## db test
 #add_executable(db_test
 #        ./test/db_test.cpp

+ 400 - 219
message/message_base.pb.cc

@@ -181,7 +181,7 @@ void InitDefaultsParkspace_info() {
 }
 
 ::google::protobuf::Metadata file_level_metadata[6];
-const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[8];
+const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[10];
 
 const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Base_info, _has_bits_),
@@ -256,30 +256,36 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUT
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Parkspace_info, parkspace_id_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Parkspace_info, block_id_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Parkspace_info, index_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Parkspace_info, direction_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Parkspace_info, floor_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Parkspace_info, length_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Parkspace_info, width_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Parkspace_info, height_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Parkspace_info, parkspace_status_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Parkspace_info, parkingspace_index_id_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Parkspace_info, parkingspace_type_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Parkspace_info, parkingspace_unit_id_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Parkspace_info, parkingspace_room_id_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Parkspace_info, parkingspace_direction_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Parkspace_info, parkingspace_floor_id_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Parkspace_info, parkingspace_width_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Parkspace_info, parkingspace_height_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Parkspace_info, parkingspace_status_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Parkspace_info, car_info_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Parkspace_info, entry_time_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Parkspace_info, leave_time_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Parkspace_info, parkspace_path_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Parkspace_info, path_estimate_time_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Parkspace_info, parkspace_status_target_),
   3,
+  13,
   4,
   5,
-  11,
+  14,
   6,
   7,
   8,
   9,
-  10,
   2,
   0,
   1,
+  12,
+  10,
+  11,
 };
 static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
   { 0, 9, sizeof(::message::Base_info)},
@@ -287,7 +293,7 @@ static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROT
   { 20, 28, sizeof(::message::Error_manager)},
   { 31, 45, sizeof(::message::Locate_information)},
   { 54, 63, sizeof(::message::Car_info)},
-  { 67, 84, sizeof(::message::Parkspace_info)},
+  { 67, 87, sizeof(::message::Parkspace_info)},
 };
 
 static ::google::protobuf::Message const * const file_default_instances[] = {
@@ -337,63 +343,74 @@ void AddDescriptorsImpl() {
       "\n\022locate_wheel_width\030\010 \001(\002\022\026\n\016locate_cor"
       "rect\030\t \001(\010\"V\n\010Car_info\022\022\n\ncar_length\030\001 \001"
       "(\002\022\021\n\tcar_width\030\002 \001(\002\022\022\n\ncar_height\030\003 \001("
-      "\002\022\017\n\007license\030\004 \001(\t\"\256\002\n\016Parkspace_info\022\024\n"
-      "\014parkspace_id\030\001 \001(\005\022\020\n\010block_id\030\002 \001(\005\022\r\n"
-      "\005index\030\003 \001(\005\022%\n\tdirection\030\004 \001(\0162\022.messag"
-      "e.Direction\022\r\n\005floor\030\005 \001(\005\022\016\n\006length\030\006 \001"
-      "(\002\022\r\n\005width\030\007 \001(\002\022\016\n\006height\030\010 \001(\002\0223\n\020par"
-      "kspace_status\030\t \001(\0162\031.message.Parkspace_"
-      "status\022#\n\010car_info\030\n \001(\0132\021.message.Car_i"
-      "nfo\022\022\n\nentry_time\030\013 \001(\t\022\022\n\nleave_time\030\014 "
-      "\001(\t*\317\007\n\014Message_type\022\r\n\teBase_msg\020\000\022\020\n\014e"
-      "Command_msg\020\001\022\026\n\022eLocate_status_msg\020\021\022\027\n"
-      "\023eLocate_request_msg\020\022\022\030\n\024eLocate_respon"
-      "se_msg\020\023\022\030\n\024eDispatch_status_msg\020!\022\031\n\025eD"
-      "ispatch_request_msg\020\"\022\032\n\026eDispatch_respo"
-      "nse_msg\020#\022$\n eParkspace_allocation_statu"
-      "s_msg\0201\022%\n!eParkspace_allocation_request"
-      "_msg\0202\022&\n\"eParkspace_allocation_response"
-      "_msg\0203\022!\n\035eParkspace_search_request_msg\020"
-      "4\022\"\n\036eParkspace_search_response_msg\0205\022\"\n"
-      "\036eParkspace_release_request_msg\0206\022#\n\037ePa"
-      "rkspace_release_response_msg\0207\022\'\n#eParks"
-      "pace_force_update_request_msg\0208\022(\n$ePark"
-      "space_force_update_response_msg\0209\022(\n$ePa"
-      "rkspace_confirm_alloc_request_msg\020:\022)\n%e"
-      "Parkspace_confirm_alloc_response_msg\020;\022\""
-      "\n\036eParkspace_allocation_data_msg\020<\022\036\n\032eS"
-      "tore_command_request_msg\020A\022\037\n\033eStore_com"
-      "mand_response_msg\020B\022\037\n\033ePickup_command_r"
-      "equest_msg\020C\022 \n\034ePickup_command_response"
-      "_msg\020D\022\037\n\032eStoring_process_statu_msg\020\220\001\022"
-      "\037\n\032ePicking_process_statu_msg\020\221\001\022\"\n\035eCen"
-      "tral_controller_statu_msg\020\240\001\022#\n\036eEntranc"
-      "e_manual_operation_msg\020\260\001\022\"\n\035eProcess_ma"
-      "nual_operation_msg\020\261\001*f\n\014Communicator\022\n\n"
-      "\006eEmpty\020\000\022\t\n\005eMain\020\001\022\016\n\teTerminor\020\200\002\022\017\n\n"
-      "eParkspace\020\200\004\022\016\n\teMeasurer\020\200\006\022\016\n\teDispat"
-      "ch\020\200\010**\n\014Process_type\022\014\n\010eStoring\020\001\022\014\n\010e"
-      "Picking\020\002*e\n\013Error_level\022\n\n\006NORMAL\020\000\022\024\n\020"
-      "NEGLIGIBLE_ERROR\020\001\022\017\n\013MINOR_ERROR\020\002\022\017\n\013M"
-      "AJOR_ERROR\020\003\022\022\n\016CRITICAL_ERROR\020\004*\207\001\n\020Par"
-      "kspace_status\022\024\n\020eParkspace_empty\020\000\022\027\n\023e"
-      "Parkspace_occupied\020\001\022\027\n\023eParkspace_reser"
-      "ved\020\002\022\025\n\021eParkspace_locked\020\003\022\024\n\020eParkspa"
-      "ce_error\020\004*(\n\tDirection\022\014\n\010eForward\020\001\022\r\n"
-      "\teBackward\020\002*\335\002\n\tStep_type\022\017\n\013eAlloc_ste"
-      "p\020\000\022\021\n\reMeasure_step\020\001\022\021\n\reCompare_step\020"
-      "\002\022\022\n\016eDispatch_step\020\003\022\021\n\reConfirm_step\020\004"
-      "\022\020\n\014eSearch_step\020\005\022\016\n\neWait_step\020\006\022\021\n\reR"
-      "elease_step\020\007\022\r\n\teComplete\020\010\022\025\n\021eBackCon"
-      "firm_step\020\t\022\026\n\022eBack_compare_step\020\n\022\025\n\021e"
-      "BackMeasure_step\020\013\022\023\n\017eBackAlloc_step\020\014\022"
-      "\022\n\016eBackWait_step\020\r\022\026\n\022eBackDispatch_ste"
-      "p\020\016\022\024\n\020eBackSearch_step\020\017\022\021\n\reBackComple"
-      "te\020\020*C\n\nStep_statu\022\014\n\010eWaiting\020\000\022\014\n\010eWor"
-      "king\020\001\022\n\n\006eError\020\002\022\r\n\teFinished\020\003"
+      "\002\022\017\n\007license\030\004 \001(\t\"\271\004\n\016Parkspace_info\022\035\n"
+      "\025parkingspace_index_id\030\001 \001(\005\0222\n\021parkings"
+      "pace_type\030\002 \001(\0162\027.message.Parkspace_type"
+      "\022\034\n\024parkingspace_unit_id\030\003 \001(\005\022\034\n\024parkin"
+      "gspace_room_id\030\004 \001(\005\0222\n\026parkingspace_dir"
+      "ection\030\005 \001(\0162\022.message.Direction\022\035\n\025park"
+      "ingspace_floor_id\030\006 \001(\005\022\032\n\022parkingspace_"
+      "width\030\007 \001(\002\022\033\n\023parkingspace_height\030\010 \001(\002"
+      "\0226\n\023parkingspace_status\030\t \001(\0162\031.message."
+      "Parkspace_status\022#\n\010car_info\030\n \001(\0132\021.mes"
+      "sage.Car_info\022\022\n\nentry_time\030\013 \001(\t\022\022\n\nlea"
+      "ve_time\030\014 \001(\t\022/\n\016parkspace_path\030\r \001(\0162\027."
+      "message.Parkspace_path\022\032\n\022path_estimate_"
+      "time\030\016 \001(\002\022:\n\027parkspace_status_target\030\017 "
+      "\001(\0162\031.message.Parkspace_status*\317\007\n\014Messa"
+      "ge_type\022\r\n\teBase_msg\020\000\022\020\n\014eCommand_msg\020\001"
+      "\022\026\n\022eLocate_status_msg\020\021\022\027\n\023eLocate_requ"
+      "est_msg\020\022\022\030\n\024eLocate_response_msg\020\023\022\030\n\024e"
+      "Dispatch_status_msg\020!\022\031\n\025eDispatch_reque"
+      "st_msg\020\"\022\032\n\026eDispatch_response_msg\020#\022$\n "
+      "eParkspace_allocation_status_msg\0201\022%\n!eP"
+      "arkspace_allocation_request_msg\0202\022&\n\"ePa"
+      "rkspace_allocation_response_msg\0203\022!\n\035ePa"
+      "rkspace_search_request_msg\0204\022\"\n\036eParkspa"
+      "ce_search_response_msg\0205\022\"\n\036eParkspace_r"
+      "elease_request_msg\0206\022#\n\037eParkspace_relea"
+      "se_response_msg\0207\022\'\n#eParkspace_force_up"
+      "date_request_msg\0208\022(\n$eParkspace_force_u"
+      "pdate_response_msg\0209\022(\n$eParkspace_confi"
+      "rm_alloc_request_msg\020:\022)\n%eParkspace_con"
+      "firm_alloc_response_msg\020;\022\"\n\036eParkspace_"
+      "allocation_data_msg\020<\022\036\n\032eStore_command_"
+      "request_msg\020A\022\037\n\033eStore_command_response"
+      "_msg\020B\022\037\n\033ePickup_command_request_msg\020C\022"
+      " \n\034ePickup_command_response_msg\020D\022\037\n\032eSt"
+      "oring_process_statu_msg\020\220\001\022\037\n\032ePicking_p"
+      "rocess_statu_msg\020\221\001\022\"\n\035eCentral_controll"
+      "er_statu_msg\020\240\001\022#\n\036eEntrance_manual_oper"
+      "ation_msg\020\260\001\022\"\n\035eProcess_manual_operatio"
+      "n_msg\020\261\001*f\n\014Communicator\022\n\n\006eEmpty\020\000\022\t\n\005"
+      "eMain\020\001\022\016\n\teTerminor\020\200\002\022\017\n\neParkspace\020\200\004"
+      "\022\016\n\teMeasurer\020\200\006\022\016\n\teDispatch\020\200\010**\n\014Proc"
+      "ess_type\022\014\n\010eStoring\020\001\022\014\n\010ePicking\020\002*e\n\013"
+      "Error_level\022\n\n\006NORMAL\020\000\022\024\n\020NEGLIGIBLE_ER"
+      "ROR\020\001\022\017\n\013MINOR_ERROR\020\002\022\017\n\013MAJOR_ERROR\020\003\022"
+      "\022\n\016CRITICAL_ERROR\020\004*\207\001\n\020Parkspace_status"
+      "\022\024\n\020eParkspace_empty\020\000\022\027\n\023eParkspace_occ"
+      "upied\020\001\022\027\n\023eParkspace_reserved\020\002\022\025\n\021ePar"
+      "kspace_locked\020\003\022\024\n\020eParkspace_error\020\004*(\n"
+      "\tDirection\022\014\n\010eForward\020\001\022\r\n\teBackward\020\002*"
+      "[\n\016Parkspace_path\022\020\n\014OPTIMAL_PATH\020\001\022\r\n\tL"
+      "EFT_PATH\020\002\022\016\n\nRIGHT_PATH\020\003\022\030\n\024TEMPORARY_"
+      "CACHE_PATH\020\004*R\n\016Parkspace_type\022\024\n\020MIN_PA"
+      "RKINGSPACE\020\001\022\024\n\020MID_PARKINGSPACE\020\002\022\024\n\020BI"
+      "G_PARKINGSPACE\020\003*\335\002\n\tStep_type\022\017\n\013eAlloc"
+      "_step\020\000\022\021\n\reMeasure_step\020\001\022\021\n\reCompare_s"
+      "tep\020\002\022\022\n\016eDispatch_step\020\003\022\021\n\reConfirm_st"
+      "ep\020\004\022\020\n\014eSearch_step\020\005\022\016\n\neWait_step\020\006\022\021"
+      "\n\reRelease_step\020\007\022\r\n\teComplete\020\010\022\025\n\021eBac"
+      "kConfirm_step\020\t\022\026\n\022eBack_compare_step\020\n\022"
+      "\025\n\021eBackMeasure_step\020\013\022\023\n\017eBackAlloc_ste"
+      "p\020\014\022\022\n\016eBackWait_step\020\r\022\026\n\022eBackDispatch"
+      "_step\020\016\022\024\n\020eBackSearch_step\020\017\022\021\n\reBackCo"
+      "mplete\020\020*C\n\nStep_statu\022\014\n\010eWaiting\020\000\022\014\n\010"
+      "eWorking\020\001\022\n\n\006eError\020\002\022\r\n\teFinished\020\003"
   };
   ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
-      descriptor, 2793);
+      descriptor, 3237);
   ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
     "message_base.proto", &protobuf_RegisterTypes);
 }
@@ -531,10 +548,41 @@ bool Direction_IsValid(int value) {
   }
 }
 
-const ::google::protobuf::EnumDescriptor* Step_type_descriptor() {
+const ::google::protobuf::EnumDescriptor* Parkspace_path_descriptor() {
   protobuf_message_5fbase_2eproto::protobuf_AssignDescriptorsOnce();
   return protobuf_message_5fbase_2eproto::file_level_enum_descriptors[6];
 }
+bool Parkspace_path_IsValid(int value) {
+  switch (value) {
+    case 1:
+    case 2:
+    case 3:
+    case 4:
+      return true;
+    default:
+      return false;
+  }
+}
+
+const ::google::protobuf::EnumDescriptor* Parkspace_type_descriptor() {
+  protobuf_message_5fbase_2eproto::protobuf_AssignDescriptorsOnce();
+  return protobuf_message_5fbase_2eproto::file_level_enum_descriptors[7];
+}
+bool Parkspace_type_IsValid(int value) {
+  switch (value) {
+    case 1:
+    case 2:
+    case 3:
+      return true;
+    default:
+      return false;
+  }
+}
+
+const ::google::protobuf::EnumDescriptor* Step_type_descriptor() {
+  protobuf_message_5fbase_2eproto::protobuf_AssignDescriptorsOnce();
+  return protobuf_message_5fbase_2eproto::file_level_enum_descriptors[8];
+}
 bool Step_type_IsValid(int value) {
   switch (value) {
     case 0:
@@ -562,7 +610,7 @@ bool Step_type_IsValid(int value) {
 
 const ::google::protobuf::EnumDescriptor* Step_statu_descriptor() {
   protobuf_message_5fbase_2eproto::protobuf_AssignDescriptorsOnce();
-  return protobuf_message_5fbase_2eproto::file_level_enum_descriptors[7];
+  return protobuf_message_5fbase_2eproto::file_level_enum_descriptors[9];
 }
 bool Step_statu_IsValid(int value) {
   switch (value) {
@@ -2522,18 +2570,21 @@ void Parkspace_info::InitAsDefaultInstance() {
       ::message::Car_info::internal_default_instance());
 }
 #if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int Parkspace_info::kParkspaceIdFieldNumber;
-const int Parkspace_info::kBlockIdFieldNumber;
-const int Parkspace_info::kIndexFieldNumber;
-const int Parkspace_info::kDirectionFieldNumber;
-const int Parkspace_info::kFloorFieldNumber;
-const int Parkspace_info::kLengthFieldNumber;
-const int Parkspace_info::kWidthFieldNumber;
-const int Parkspace_info::kHeightFieldNumber;
-const int Parkspace_info::kParkspaceStatusFieldNumber;
+const int Parkspace_info::kParkingspaceIndexIdFieldNumber;
+const int Parkspace_info::kParkingspaceTypeFieldNumber;
+const int Parkspace_info::kParkingspaceUnitIdFieldNumber;
+const int Parkspace_info::kParkingspaceRoomIdFieldNumber;
+const int Parkspace_info::kParkingspaceDirectionFieldNumber;
+const int Parkspace_info::kParkingspaceFloorIdFieldNumber;
+const int Parkspace_info::kParkingspaceWidthFieldNumber;
+const int Parkspace_info::kParkingspaceHeightFieldNumber;
+const int Parkspace_info::kParkingspaceStatusFieldNumber;
 const int Parkspace_info::kCarInfoFieldNumber;
 const int Parkspace_info::kEntryTimeFieldNumber;
 const int Parkspace_info::kLeaveTimeFieldNumber;
+const int Parkspace_info::kParkspacePathFieldNumber;
+const int Parkspace_info::kPathEstimateTimeFieldNumber;
+const int Parkspace_info::kParkspaceStatusTargetFieldNumber;
 #endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
 
 Parkspace_info::Parkspace_info()
@@ -2563,9 +2614,9 @@ Parkspace_info::Parkspace_info(const Parkspace_info& from)
   } else {
     car_info_ = NULL;
   }
-  ::memcpy(&parkspace_id_, &from.parkspace_id_,
-    static_cast<size_t>(reinterpret_cast<char*>(&direction_) -
-    reinterpret_cast<char*>(&parkspace_id_)) + sizeof(direction_));
+  ::memcpy(&parkingspace_index_id_, &from.parkingspace_index_id_,
+    static_cast<size_t>(reinterpret_cast<char*>(&parkingspace_direction_) -
+    reinterpret_cast<char*>(&parkingspace_index_id_)) + sizeof(parkingspace_direction_));
   // @@protoc_insertion_point(copy_constructor:message.Parkspace_info)
 }
 
@@ -2574,9 +2625,11 @@ void Parkspace_info::SharedCtor() {
   entry_time_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
   leave_time_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
   ::memset(&car_info_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&parkspace_status_) -
-      reinterpret_cast<char*>(&car_info_)) + sizeof(parkspace_status_));
-  direction_ = 1;
+      reinterpret_cast<char*>(&parkspace_status_target_) -
+      reinterpret_cast<char*>(&car_info_)) + sizeof(parkspace_status_target_));
+  parkspace_path_ = 1;
+  parkingspace_type_ = 1;
+  parkingspace_direction_ = 1;
 }
 
 Parkspace_info::~Parkspace_info() {
@@ -2635,15 +2688,17 @@ void Parkspace_info::Clear() {
     }
   }
   if (cached_has_bits & 248u) {
-    ::memset(&parkspace_id_, 0, static_cast<size_t>(
-        reinterpret_cast<char*>(&length_) -
-        reinterpret_cast<char*>(&parkspace_id_)) + sizeof(length_));
-  }
-  if (cached_has_bits & 3840u) {
-    ::memset(&width_, 0, static_cast<size_t>(
-        reinterpret_cast<char*>(&parkspace_status_) -
-        reinterpret_cast<char*>(&width_)) + sizeof(parkspace_status_));
-    direction_ = 1;
+    ::memset(&parkingspace_index_id_, 0, static_cast<size_t>(
+        reinterpret_cast<char*>(&parkingspace_width_) -
+        reinterpret_cast<char*>(&parkingspace_index_id_)) + sizeof(parkingspace_width_));
+  }
+  if (cached_has_bits & 32512u) {
+    ::memset(&parkingspace_height_, 0, static_cast<size_t>(
+        reinterpret_cast<char*>(&parkspace_status_target_) -
+        reinterpret_cast<char*>(&parkingspace_height_)) + sizeof(parkspace_status_target_));
+    parkspace_path_ = 1;
+    parkingspace_type_ = 1;
+    parkingspace_direction_ = 1;
   }
   _has_bits_.Clear();
   _internal_metadata_.Clear();
@@ -2659,125 +2714,131 @@ bool Parkspace_info::MergePartialFromCodedStream(
     tag = p.first;
     if (!p.second) goto handle_unusual;
     switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
-      // optional int32 parkspace_id = 1;
+      // optional int32 parkingspace_index_id = 1;
       case 1: {
         if (static_cast< ::google::protobuf::uint8>(tag) ==
             static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          set_has_parkspace_id();
+          set_has_parkingspace_index_id();
           DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                    ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &parkspace_id_)));
+                 input, &parkingspace_index_id_)));
         } else {
           goto handle_unusual;
         }
         break;
       }
 
-      // optional int32 block_id = 2;
+      // optional .message.Parkspace_type parkingspace_type = 2;
       case 2: {
         if (static_cast< ::google::protobuf::uint8>(tag) ==
             static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          set_has_block_id();
+          int value;
           DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &block_id_)));
+                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
+                 input, &value)));
+          if (::message::Parkspace_type_IsValid(value)) {
+            set_parkingspace_type(static_cast< ::message::Parkspace_type >(value));
+          } else {
+            mutable_unknown_fields()->AddVarint(
+                2, static_cast< ::google::protobuf::uint64>(value));
+          }
         } else {
           goto handle_unusual;
         }
         break;
       }
 
-      // optional int32 index = 3;
+      // optional int32 parkingspace_unit_id = 3;
       case 3: {
         if (static_cast< ::google::protobuf::uint8>(tag) ==
             static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
-          set_has_index();
+          set_has_parkingspace_unit_id();
           DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                    ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &index_)));
+                 input, &parkingspace_unit_id_)));
         } else {
           goto handle_unusual;
         }
         break;
       }
 
-      // optional .message.Direction direction = 4;
+      // optional int32 parkingspace_room_id = 4;
       case 4: {
         if (static_cast< ::google::protobuf::uint8>(tag) ==
             static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
-          int value;
+          set_has_parkingspace_room_id();
           DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::message::Direction_IsValid(value)) {
-            set_direction(static_cast< ::message::Direction >(value));
-          } else {
-            mutable_unknown_fields()->AddVarint(
-                4, static_cast< ::google::protobuf::uint64>(value));
-          }
+                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
+                 input, &parkingspace_room_id_)));
         } else {
           goto handle_unusual;
         }
         break;
       }
 
-      // optional int32 floor = 5;
+      // optional .message.Direction parkingspace_direction = 5;
       case 5: {
         if (static_cast< ::google::protobuf::uint8>(tag) ==
             static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) {
-          set_has_floor();
+          int value;
           DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &floor_)));
+                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
+                 input, &value)));
+          if (::message::Direction_IsValid(value)) {
+            set_parkingspace_direction(static_cast< ::message::Direction >(value));
+          } else {
+            mutable_unknown_fields()->AddVarint(
+                5, static_cast< ::google::protobuf::uint64>(value));
+          }
         } else {
           goto handle_unusual;
         }
         break;
       }
 
-      // optional float length = 6;
+      // optional int32 parkingspace_floor_id = 6;
       case 6: {
         if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(53u /* 53 & 0xFF */)) {
-          set_has_length();
+            static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) {
+          set_has_parkingspace_floor_id();
           DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &length_)));
+                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
+                 input, &parkingspace_floor_id_)));
         } else {
           goto handle_unusual;
         }
         break;
       }
 
-      // optional float width = 7;
+      // optional float parkingspace_width = 7;
       case 7: {
         if (static_cast< ::google::protobuf::uint8>(tag) ==
             static_cast< ::google::protobuf::uint8>(61u /* 61 & 0xFF */)) {
-          set_has_width();
+          set_has_parkingspace_width();
           DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                    float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &width_)));
+                 input, &parkingspace_width_)));
         } else {
           goto handle_unusual;
         }
         break;
       }
 
-      // optional float height = 8;
+      // optional float parkingspace_height = 8;
       case 8: {
         if (static_cast< ::google::protobuf::uint8>(tag) ==
             static_cast< ::google::protobuf::uint8>(69u /* 69 & 0xFF */)) {
-          set_has_height();
+          set_has_parkingspace_height();
           DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                    float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &height_)));
+                 input, &parkingspace_height_)));
         } else {
           goto handle_unusual;
         }
         break;
       }
 
-      // optional .message.Parkspace_status parkspace_status = 9;
+      // optional .message.Parkspace_status parkingspace_status = 9;
       case 9: {
         if (static_cast< ::google::protobuf::uint8>(tag) ==
             static_cast< ::google::protobuf::uint8>(72u /* 72 & 0xFF */)) {
@@ -2786,7 +2847,7 @@ bool Parkspace_info::MergePartialFromCodedStream(
                    int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
                  input, &value)));
           if (::message::Parkspace_status_IsValid(value)) {
-            set_parkspace_status(static_cast< ::message::Parkspace_status >(value));
+            set_parkingspace_status(static_cast< ::message::Parkspace_status >(value));
           } else {
             mutable_unknown_fields()->AddVarint(
                 9, static_cast< ::google::protobuf::uint64>(value));
@@ -2841,6 +2902,60 @@ bool Parkspace_info::MergePartialFromCodedStream(
         break;
       }
 
+      // optional .message.Parkspace_path parkspace_path = 13;
+      case 13: {
+        if (static_cast< ::google::protobuf::uint8>(tag) ==
+            static_cast< ::google::protobuf::uint8>(104u /* 104 & 0xFF */)) {
+          int value;
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
+                 input, &value)));
+          if (::message::Parkspace_path_IsValid(value)) {
+            set_parkspace_path(static_cast< ::message::Parkspace_path >(value));
+          } else {
+            mutable_unknown_fields()->AddVarint(
+                13, static_cast< ::google::protobuf::uint64>(value));
+          }
+        } else {
+          goto handle_unusual;
+        }
+        break;
+      }
+
+      // optional float path_estimate_time = 14;
+      case 14: {
+        if (static_cast< ::google::protobuf::uint8>(tag) ==
+            static_cast< ::google::protobuf::uint8>(117u /* 117 & 0xFF */)) {
+          set_has_path_estimate_time();
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
+                 input, &path_estimate_time_)));
+        } else {
+          goto handle_unusual;
+        }
+        break;
+      }
+
+      // optional .message.Parkspace_status parkspace_status_target = 15;
+      case 15: {
+        if (static_cast< ::google::protobuf::uint8>(tag) ==
+            static_cast< ::google::protobuf::uint8>(120u /* 120 & 0xFF */)) {
+          int value;
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
+                 input, &value)));
+          if (::message::Parkspace_status_IsValid(value)) {
+            set_parkspace_status_target(static_cast< ::message::Parkspace_status >(value));
+          } else {
+            mutable_unknown_fields()->AddVarint(
+                15, static_cast< ::google::protobuf::uint64>(value));
+          }
+        } else {
+          goto handle_unusual;
+        }
+        break;
+      }
+
       default: {
       handle_unusual:
         if (tag == 0) {
@@ -2868,51 +2983,52 @@ void Parkspace_info::SerializeWithCachedSizes(
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
-  // optional int32 parkspace_id = 1;
+  // optional int32 parkingspace_index_id = 1;
   if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->parkspace_id(), output);
+    ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->parkingspace_index_id(), output);
+  }
+
+  // optional .message.Parkspace_type parkingspace_type = 2;
+  if (cached_has_bits & 0x00002000u) {
+    ::google::protobuf::internal::WireFormatLite::WriteEnum(
+      2, this->parkingspace_type(), output);
   }
 
-  // optional int32 block_id = 2;
+  // optional int32 parkingspace_unit_id = 3;
   if (cached_has_bits & 0x00000010u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->block_id(), output);
+    ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->parkingspace_unit_id(), output);
   }
 
-  // optional int32 index = 3;
+  // optional int32 parkingspace_room_id = 4;
   if (cached_has_bits & 0x00000020u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->index(), output);
+    ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->parkingspace_room_id(), output);
   }
 
-  // optional .message.Direction direction = 4;
-  if (cached_has_bits & 0x00000800u) {
+  // optional .message.Direction parkingspace_direction = 5;
+  if (cached_has_bits & 0x00004000u) {
     ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      4, this->direction(), output);
+      5, this->parkingspace_direction(), output);
   }
 
-  // optional int32 floor = 5;
+  // optional int32 parkingspace_floor_id = 6;
   if (cached_has_bits & 0x00000040u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(5, this->floor(), output);
+    ::google::protobuf::internal::WireFormatLite::WriteInt32(6, this->parkingspace_floor_id(), output);
   }
 
-  // optional float length = 6;
+  // optional float parkingspace_width = 7;
   if (cached_has_bits & 0x00000080u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(6, this->length(), output);
+    ::google::protobuf::internal::WireFormatLite::WriteFloat(7, this->parkingspace_width(), output);
   }
 
-  // optional float width = 7;
+  // optional float parkingspace_height = 8;
   if (cached_has_bits & 0x00000100u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(7, this->width(), output);
+    ::google::protobuf::internal::WireFormatLite::WriteFloat(8, this->parkingspace_height(), output);
   }
 
-  // optional float height = 8;
+  // optional .message.Parkspace_status parkingspace_status = 9;
   if (cached_has_bits & 0x00000200u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(8, this->height(), output);
-  }
-
-  // optional .message.Parkspace_status parkspace_status = 9;
-  if (cached_has_bits & 0x00000400u) {
     ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      9, this->parkspace_status(), output);
+      9, this->parkingspace_status(), output);
   }
 
   // optional .message.Car_info car_info = 10;
@@ -2941,6 +3057,23 @@ void Parkspace_info::SerializeWithCachedSizes(
       12, this->leave_time(), output);
   }
 
+  // optional .message.Parkspace_path parkspace_path = 13;
+  if (cached_has_bits & 0x00001000u) {
+    ::google::protobuf::internal::WireFormatLite::WriteEnum(
+      13, this->parkspace_path(), output);
+  }
+
+  // optional float path_estimate_time = 14;
+  if (cached_has_bits & 0x00000400u) {
+    ::google::protobuf::internal::WireFormatLite::WriteFloat(14, this->path_estimate_time(), output);
+  }
+
+  // optional .message.Parkspace_status parkspace_status_target = 15;
+  if (cached_has_bits & 0x00000800u) {
+    ::google::protobuf::internal::WireFormatLite::WriteEnum(
+      15, this->parkspace_status_target(), output);
+  }
+
   if (_internal_metadata_.have_unknown_fields()) {
     ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
         _internal_metadata_.unknown_fields(), output);
@@ -2956,51 +3089,52 @@ void Parkspace_info::SerializeWithCachedSizes(
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
-  // optional int32 parkspace_id = 1;
+  // optional int32 parkingspace_index_id = 1;
   if (cached_has_bits & 0x00000008u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->parkspace_id(), target);
+    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->parkingspace_index_id(), target);
+  }
+
+  // optional .message.Parkspace_type parkingspace_type = 2;
+  if (cached_has_bits & 0x00002000u) {
+    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
+      2, this->parkingspace_type(), target);
   }
 
-  // optional int32 block_id = 2;
+  // optional int32 parkingspace_unit_id = 3;
   if (cached_has_bits & 0x00000010u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->block_id(), target);
+    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->parkingspace_unit_id(), target);
   }
 
-  // optional int32 index = 3;
+  // optional int32 parkingspace_room_id = 4;
   if (cached_has_bits & 0x00000020u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->index(), target);
+    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->parkingspace_room_id(), target);
   }
 
-  // optional .message.Direction direction = 4;
-  if (cached_has_bits & 0x00000800u) {
+  // optional .message.Direction parkingspace_direction = 5;
+  if (cached_has_bits & 0x00004000u) {
     target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      4, this->direction(), target);
+      5, this->parkingspace_direction(), target);
   }
 
-  // optional int32 floor = 5;
+  // optional int32 parkingspace_floor_id = 6;
   if (cached_has_bits & 0x00000040u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(5, this->floor(), target);
+    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(6, this->parkingspace_floor_id(), target);
   }
 
-  // optional float length = 6;
+  // optional float parkingspace_width = 7;
   if (cached_has_bits & 0x00000080u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(6, this->length(), target);
+    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(7, this->parkingspace_width(), target);
   }
 
-  // optional float width = 7;
+  // optional float parkingspace_height = 8;
   if (cached_has_bits & 0x00000100u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(7, this->width(), target);
+    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(8, this->parkingspace_height(), target);
   }
 
-  // optional float height = 8;
+  // optional .message.Parkspace_status parkingspace_status = 9;
   if (cached_has_bits & 0x00000200u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(8, this->height(), target);
-  }
-
-  // optional .message.Parkspace_status parkspace_status = 9;
-  if (cached_has_bits & 0x00000400u) {
     target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      9, this->parkspace_status(), target);
+      9, this->parkingspace_status(), target);
   }
 
   // optional .message.Car_info car_info = 10;
@@ -3032,6 +3166,23 @@ void Parkspace_info::SerializeWithCachedSizes(
         12, this->leave_time(), target);
   }
 
+  // optional .message.Parkspace_path parkspace_path = 13;
+  if (cached_has_bits & 0x00001000u) {
+    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
+      13, this->parkspace_path(), target);
+  }
+
+  // optional float path_estimate_time = 14;
+  if (cached_has_bits & 0x00000400u) {
+    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(14, this->path_estimate_time(), target);
+  }
+
+  // optional .message.Parkspace_status parkspace_status_target = 15;
+  if (cached_has_bits & 0x00000800u) {
+    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
+      15, this->parkspace_status_target(), target);
+  }
+
   if (_internal_metadata_.have_unknown_fields()) {
     target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
         _internal_metadata_.unknown_fields(), target);
@@ -3071,61 +3222,79 @@ size_t Parkspace_info::ByteSizeLong() const {
           *this->car_info_);
     }
 
-    // optional int32 parkspace_id = 1;
-    if (has_parkspace_id()) {
+    // optional int32 parkingspace_index_id = 1;
+    if (has_parkingspace_index_id()) {
       total_size += 1 +
         ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->parkspace_id());
+          this->parkingspace_index_id());
     }
 
-    // optional int32 block_id = 2;
-    if (has_block_id()) {
+    // optional int32 parkingspace_unit_id = 3;
+    if (has_parkingspace_unit_id()) {
       total_size += 1 +
         ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->block_id());
+          this->parkingspace_unit_id());
     }
 
-    // optional int32 index = 3;
-    if (has_index()) {
+    // optional int32 parkingspace_room_id = 4;
+    if (has_parkingspace_room_id()) {
       total_size += 1 +
         ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->index());
+          this->parkingspace_room_id());
     }
 
-    // optional int32 floor = 5;
-    if (has_floor()) {
+    // optional int32 parkingspace_floor_id = 6;
+    if (has_parkingspace_floor_id()) {
       total_size += 1 +
         ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->floor());
+          this->parkingspace_floor_id());
     }
 
-    // optional float length = 6;
-    if (has_length()) {
+    // optional float parkingspace_width = 7;
+    if (has_parkingspace_width()) {
       total_size += 1 + 4;
     }
 
   }
-  if (_has_bits_[8 / 32] & 3840u) {
-    // optional float width = 7;
-    if (has_width()) {
+  if (_has_bits_[8 / 32] & 32512u) {
+    // optional float parkingspace_height = 8;
+    if (has_parkingspace_height()) {
       total_size += 1 + 4;
     }
 
-    // optional float height = 8;
-    if (has_height()) {
+    // optional .message.Parkspace_status parkingspace_status = 9;
+    if (has_parkingspace_status()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::EnumSize(this->parkingspace_status());
+    }
+
+    // optional float path_estimate_time = 14;
+    if (has_path_estimate_time()) {
       total_size += 1 + 4;
     }
 
-    // optional .message.Parkspace_status parkspace_status = 9;
-    if (has_parkspace_status()) {
+    // optional .message.Parkspace_status parkspace_status_target = 15;
+    if (has_parkspace_status_target()) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::EnumSize(this->parkspace_status());
+        ::google::protobuf::internal::WireFormatLite::EnumSize(this->parkspace_status_target());
     }
 
-    // optional .message.Direction direction = 4;
-    if (has_direction()) {
+    // optional .message.Parkspace_path parkspace_path = 13;
+    if (has_parkspace_path()) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::EnumSize(this->direction());
+        ::google::protobuf::internal::WireFormatLite::EnumSize(this->parkspace_path());
+    }
+
+    // optional .message.Parkspace_type parkingspace_type = 2;
+    if (has_parkingspace_type()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::EnumSize(this->parkingspace_type());
+    }
+
+    // optional .message.Direction parkingspace_direction = 5;
+    if (has_parkingspace_direction()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::EnumSize(this->parkingspace_direction());
     }
 
   }
@@ -3172,34 +3341,43 @@ void Parkspace_info::MergeFrom(const Parkspace_info& from) {
       mutable_car_info()->::message::Car_info::MergeFrom(from.car_info());
     }
     if (cached_has_bits & 0x00000008u) {
-      parkspace_id_ = from.parkspace_id_;
+      parkingspace_index_id_ = from.parkingspace_index_id_;
     }
     if (cached_has_bits & 0x00000010u) {
-      block_id_ = from.block_id_;
+      parkingspace_unit_id_ = from.parkingspace_unit_id_;
     }
     if (cached_has_bits & 0x00000020u) {
-      index_ = from.index_;
+      parkingspace_room_id_ = from.parkingspace_room_id_;
     }
     if (cached_has_bits & 0x00000040u) {
-      floor_ = from.floor_;
+      parkingspace_floor_id_ = from.parkingspace_floor_id_;
     }
     if (cached_has_bits & 0x00000080u) {
-      length_ = from.length_;
+      parkingspace_width_ = from.parkingspace_width_;
     }
     _has_bits_[0] |= cached_has_bits;
   }
-  if (cached_has_bits & 3840u) {
+  if (cached_has_bits & 32512u) {
     if (cached_has_bits & 0x00000100u) {
-      width_ = from.width_;
+      parkingspace_height_ = from.parkingspace_height_;
     }
     if (cached_has_bits & 0x00000200u) {
-      height_ = from.height_;
+      parkingspace_status_ = from.parkingspace_status_;
     }
     if (cached_has_bits & 0x00000400u) {
-      parkspace_status_ = from.parkspace_status_;
+      path_estimate_time_ = from.path_estimate_time_;
     }
     if (cached_has_bits & 0x00000800u) {
-      direction_ = from.direction_;
+      parkspace_status_target_ = from.parkspace_status_target_;
+    }
+    if (cached_has_bits & 0x00001000u) {
+      parkspace_path_ = from.parkspace_path_;
+    }
+    if (cached_has_bits & 0x00002000u) {
+      parkingspace_type_ = from.parkingspace_type_;
+    }
+    if (cached_has_bits & 0x00004000u) {
+      parkingspace_direction_ = from.parkingspace_direction_;
     }
     _has_bits_[0] |= cached_has_bits;
   }
@@ -3232,15 +3410,18 @@ void Parkspace_info::InternalSwap(Parkspace_info* other) {
   entry_time_.Swap(&other->entry_time_);
   leave_time_.Swap(&other->leave_time_);
   swap(car_info_, other->car_info_);
-  swap(parkspace_id_, other->parkspace_id_);
-  swap(block_id_, other->block_id_);
-  swap(index_, other->index_);
-  swap(floor_, other->floor_);
-  swap(length_, other->length_);
-  swap(width_, other->width_);
-  swap(height_, other->height_);
-  swap(parkspace_status_, other->parkspace_status_);
-  swap(direction_, other->direction_);
+  swap(parkingspace_index_id_, other->parkingspace_index_id_);
+  swap(parkingspace_unit_id_, other->parkingspace_unit_id_);
+  swap(parkingspace_room_id_, other->parkingspace_room_id_);
+  swap(parkingspace_floor_id_, other->parkingspace_floor_id_);
+  swap(parkingspace_width_, other->parkingspace_width_);
+  swap(parkingspace_height_, other->parkingspace_height_);
+  swap(parkingspace_status_, other->parkingspace_status_);
+  swap(path_estimate_time_, other->path_estimate_time_);
+  swap(parkspace_status_target_, other->parkspace_status_target_);
+  swap(parkspace_path_, other->parkspace_path_);
+  swap(parkingspace_type_, other->parkingspace_type_);
+  swap(parkingspace_direction_, other->parkingspace_direction_);
   swap(_has_bits_[0], other->_has_bits_[0]);
   _internal_metadata_.Swap(&other->_internal_metadata_);
   swap(_cached_size_, other->_cached_size_);

+ 384 - 228
message/message_base.pb.h

@@ -237,6 +237,47 @@ inline bool Direction_Parse(
   return ::google::protobuf::internal::ParseNamedEnum<Direction>(
     Direction_descriptor(), name, value);
 }
+enum Parkspace_path {
+  OPTIMAL_PATH = 1,
+  LEFT_PATH = 2,
+  RIGHT_PATH = 3,
+  TEMPORARY_CACHE_PATH = 4
+};
+bool Parkspace_path_IsValid(int value);
+const Parkspace_path Parkspace_path_MIN = OPTIMAL_PATH;
+const Parkspace_path Parkspace_path_MAX = TEMPORARY_CACHE_PATH;
+const int Parkspace_path_ARRAYSIZE = Parkspace_path_MAX + 1;
+
+const ::google::protobuf::EnumDescriptor* Parkspace_path_descriptor();
+inline const ::std::string& Parkspace_path_Name(Parkspace_path value) {
+  return ::google::protobuf::internal::NameOfEnum(
+    Parkspace_path_descriptor(), value);
+}
+inline bool Parkspace_path_Parse(
+    const ::std::string& name, Parkspace_path* value) {
+  return ::google::protobuf::internal::ParseNamedEnum<Parkspace_path>(
+    Parkspace_path_descriptor(), name, value);
+}
+enum Parkspace_type {
+  MIN_PARKINGSPACE = 1,
+  MID_PARKINGSPACE = 2,
+  BIG_PARKINGSPACE = 3
+};
+bool Parkspace_type_IsValid(int value);
+const Parkspace_type Parkspace_type_MIN = MIN_PARKINGSPACE;
+const Parkspace_type Parkspace_type_MAX = BIG_PARKINGSPACE;
+const int Parkspace_type_ARRAYSIZE = Parkspace_type_MAX + 1;
+
+const ::google::protobuf::EnumDescriptor* Parkspace_type_descriptor();
+inline const ::std::string& Parkspace_type_Name(Parkspace_type value) {
+  return ::google::protobuf::internal::NameOfEnum(
+    Parkspace_type_descriptor(), value);
+}
+inline bool Parkspace_type_Parse(
+    const ::std::string& name, Parkspace_type* value) {
+  return ::google::protobuf::internal::ParseNamedEnum<Parkspace_type>(
+    Parkspace_type_descriptor(), name, value);
+}
 enum Step_type {
   eAlloc_step = 0,
   eMeasure_step = 1,
@@ -1153,95 +1194,122 @@ class Parkspace_info : public ::google::protobuf::Message /* @@protoc_insertion_
   ::message::Car_info* mutable_car_info();
   void set_allocated_car_info(::message::Car_info* car_info);
 
-  // optional int32 parkspace_id = 1;
-  bool has_parkspace_id() const;
-  void clear_parkspace_id();
-  static const int kParkspaceIdFieldNumber = 1;
-  ::google::protobuf::int32 parkspace_id() const;
-  void set_parkspace_id(::google::protobuf::int32 value);
-
-  // optional int32 block_id = 2;
-  bool has_block_id() const;
-  void clear_block_id();
-  static const int kBlockIdFieldNumber = 2;
-  ::google::protobuf::int32 block_id() const;
-  void set_block_id(::google::protobuf::int32 value);
-
-  // optional int32 index = 3;
-  bool has_index() const;
-  void clear_index();
-  static const int kIndexFieldNumber = 3;
-  ::google::protobuf::int32 index() const;
-  void set_index(::google::protobuf::int32 value);
-
-  // optional int32 floor = 5;
-  bool has_floor() const;
-  void clear_floor();
-  static const int kFloorFieldNumber = 5;
-  ::google::protobuf::int32 floor() const;
-  void set_floor(::google::protobuf::int32 value);
-
-  // optional float length = 6;
-  bool has_length() const;
-  void clear_length();
-  static const int kLengthFieldNumber = 6;
-  float length() const;
-  void set_length(float value);
-
-  // optional float width = 7;
-  bool has_width() const;
-  void clear_width();
-  static const int kWidthFieldNumber = 7;
-  float width() const;
-  void set_width(float value);
-
-  // optional float height = 8;
-  bool has_height() const;
-  void clear_height();
-  static const int kHeightFieldNumber = 8;
-  float height() const;
-  void set_height(float value);
-
-  // optional .message.Parkspace_status parkspace_status = 9;
-  bool has_parkspace_status() const;
-  void clear_parkspace_status();
-  static const int kParkspaceStatusFieldNumber = 9;
-  ::message::Parkspace_status parkspace_status() const;
-  void set_parkspace_status(::message::Parkspace_status value);
-
-  // optional .message.Direction direction = 4;
-  bool has_direction() const;
-  void clear_direction();
-  static const int kDirectionFieldNumber = 4;
-  ::message::Direction direction() const;
-  void set_direction(::message::Direction value);
+  // optional int32 parkingspace_index_id = 1;
+  bool has_parkingspace_index_id() const;
+  void clear_parkingspace_index_id();
+  static const int kParkingspaceIndexIdFieldNumber = 1;
+  ::google::protobuf::int32 parkingspace_index_id() const;
+  void set_parkingspace_index_id(::google::protobuf::int32 value);
+
+  // optional int32 parkingspace_unit_id = 3;
+  bool has_parkingspace_unit_id() const;
+  void clear_parkingspace_unit_id();
+  static const int kParkingspaceUnitIdFieldNumber = 3;
+  ::google::protobuf::int32 parkingspace_unit_id() const;
+  void set_parkingspace_unit_id(::google::protobuf::int32 value);
+
+  // optional int32 parkingspace_room_id = 4;
+  bool has_parkingspace_room_id() const;
+  void clear_parkingspace_room_id();
+  static const int kParkingspaceRoomIdFieldNumber = 4;
+  ::google::protobuf::int32 parkingspace_room_id() const;
+  void set_parkingspace_room_id(::google::protobuf::int32 value);
+
+  // optional int32 parkingspace_floor_id = 6;
+  bool has_parkingspace_floor_id() const;
+  void clear_parkingspace_floor_id();
+  static const int kParkingspaceFloorIdFieldNumber = 6;
+  ::google::protobuf::int32 parkingspace_floor_id() const;
+  void set_parkingspace_floor_id(::google::protobuf::int32 value);
+
+  // optional float parkingspace_width = 7;
+  bool has_parkingspace_width() const;
+  void clear_parkingspace_width();
+  static const int kParkingspaceWidthFieldNumber = 7;
+  float parkingspace_width() const;
+  void set_parkingspace_width(float value);
+
+  // optional float parkingspace_height = 8;
+  bool has_parkingspace_height() const;
+  void clear_parkingspace_height();
+  static const int kParkingspaceHeightFieldNumber = 8;
+  float parkingspace_height() const;
+  void set_parkingspace_height(float value);
+
+  // optional .message.Parkspace_status parkingspace_status = 9;
+  bool has_parkingspace_status() const;
+  void clear_parkingspace_status();
+  static const int kParkingspaceStatusFieldNumber = 9;
+  ::message::Parkspace_status parkingspace_status() const;
+  void set_parkingspace_status(::message::Parkspace_status value);
+
+  // optional float path_estimate_time = 14;
+  bool has_path_estimate_time() const;
+  void clear_path_estimate_time();
+  static const int kPathEstimateTimeFieldNumber = 14;
+  float path_estimate_time() const;
+  void set_path_estimate_time(float value);
+
+  // optional .message.Parkspace_status parkspace_status_target = 15;
+  bool has_parkspace_status_target() const;
+  void clear_parkspace_status_target();
+  static const int kParkspaceStatusTargetFieldNumber = 15;
+  ::message::Parkspace_status parkspace_status_target() const;
+  void set_parkspace_status_target(::message::Parkspace_status value);
+
+  // optional .message.Parkspace_path parkspace_path = 13;
+  bool has_parkspace_path() const;
+  void clear_parkspace_path();
+  static const int kParkspacePathFieldNumber = 13;
+  ::message::Parkspace_path parkspace_path() const;
+  void set_parkspace_path(::message::Parkspace_path value);
+
+  // optional .message.Parkspace_type parkingspace_type = 2;
+  bool has_parkingspace_type() const;
+  void clear_parkingspace_type();
+  static const int kParkingspaceTypeFieldNumber = 2;
+  ::message::Parkspace_type parkingspace_type() const;
+  void set_parkingspace_type(::message::Parkspace_type value);
+
+  // optional .message.Direction parkingspace_direction = 5;
+  bool has_parkingspace_direction() const;
+  void clear_parkingspace_direction();
+  static const int kParkingspaceDirectionFieldNumber = 5;
+  ::message::Direction parkingspace_direction() const;
+  void set_parkingspace_direction(::message::Direction value);
 
   // @@protoc_insertion_point(class_scope:message.Parkspace_info)
  private:
-  void set_has_parkspace_id();
-  void clear_has_parkspace_id();
-  void set_has_block_id();
-  void clear_has_block_id();
-  void set_has_index();
-  void clear_has_index();
-  void set_has_direction();
-  void clear_has_direction();
-  void set_has_floor();
-  void clear_has_floor();
-  void set_has_length();
-  void clear_has_length();
-  void set_has_width();
-  void clear_has_width();
-  void set_has_height();
-  void clear_has_height();
-  void set_has_parkspace_status();
-  void clear_has_parkspace_status();
+  void set_has_parkingspace_index_id();
+  void clear_has_parkingspace_index_id();
+  void set_has_parkingspace_type();
+  void clear_has_parkingspace_type();
+  void set_has_parkingspace_unit_id();
+  void clear_has_parkingspace_unit_id();
+  void set_has_parkingspace_room_id();
+  void clear_has_parkingspace_room_id();
+  void set_has_parkingspace_direction();
+  void clear_has_parkingspace_direction();
+  void set_has_parkingspace_floor_id();
+  void clear_has_parkingspace_floor_id();
+  void set_has_parkingspace_width();
+  void clear_has_parkingspace_width();
+  void set_has_parkingspace_height();
+  void clear_has_parkingspace_height();
+  void set_has_parkingspace_status();
+  void clear_has_parkingspace_status();
   void set_has_car_info();
   void clear_has_car_info();
   void set_has_entry_time();
   void clear_has_entry_time();
   void set_has_leave_time();
   void clear_has_leave_time();
+  void set_has_parkspace_path();
+  void clear_has_parkspace_path();
+  void set_has_path_estimate_time();
+  void clear_has_path_estimate_time();
+  void set_has_parkspace_status_target();
+  void clear_has_parkspace_status_target();
 
   ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
   ::google::protobuf::internal::HasBits<1> _has_bits_;
@@ -1249,15 +1317,18 @@ class Parkspace_info : public ::google::protobuf::Message /* @@protoc_insertion_
   ::google::protobuf::internal::ArenaStringPtr entry_time_;
   ::google::protobuf::internal::ArenaStringPtr leave_time_;
   ::message::Car_info* car_info_;
-  ::google::protobuf::int32 parkspace_id_;
-  ::google::protobuf::int32 block_id_;
-  ::google::protobuf::int32 index_;
-  ::google::protobuf::int32 floor_;
-  float length_;
-  float width_;
-  float height_;
-  int parkspace_status_;
-  int direction_;
+  ::google::protobuf::int32 parkingspace_index_id_;
+  ::google::protobuf::int32 parkingspace_unit_id_;
+  ::google::protobuf::int32 parkingspace_room_id_;
+  ::google::protobuf::int32 parkingspace_floor_id_;
+  float parkingspace_width_;
+  float parkingspace_height_;
+  int parkingspace_status_;
+  float path_estimate_time_;
+  int parkspace_status_target_;
+  int parkspace_path_;
+  int parkingspace_type_;
+  int parkingspace_direction_;
   friend struct ::protobuf_message_5fbase_2eproto::TableStruct;
   friend void ::protobuf_message_5fbase_2eproto::InitDefaultsParkspace_infoImpl();
 };
@@ -1908,222 +1979,223 @@ inline void Car_info::set_allocated_license(::std::string* license) {
 
 // Parkspace_info
 
-// optional int32 parkspace_id = 1;
-inline bool Parkspace_info::has_parkspace_id() const {
+// optional int32 parkingspace_index_id = 1;
+inline bool Parkspace_info::has_parkingspace_index_id() const {
   return (_has_bits_[0] & 0x00000008u) != 0;
 }
-inline void Parkspace_info::set_has_parkspace_id() {
+inline void Parkspace_info::set_has_parkingspace_index_id() {
   _has_bits_[0] |= 0x00000008u;
 }
-inline void Parkspace_info::clear_has_parkspace_id() {
+inline void Parkspace_info::clear_has_parkingspace_index_id() {
   _has_bits_[0] &= ~0x00000008u;
 }
-inline void Parkspace_info::clear_parkspace_id() {
-  parkspace_id_ = 0;
-  clear_has_parkspace_id();
+inline void Parkspace_info::clear_parkingspace_index_id() {
+  parkingspace_index_id_ = 0;
+  clear_has_parkingspace_index_id();
 }
-inline ::google::protobuf::int32 Parkspace_info::parkspace_id() const {
-  // @@protoc_insertion_point(field_get:message.Parkspace_info.parkspace_id)
-  return parkspace_id_;
+inline ::google::protobuf::int32 Parkspace_info::parkingspace_index_id() const {
+  // @@protoc_insertion_point(field_get:message.Parkspace_info.parkingspace_index_id)
+  return parkingspace_index_id_;
 }
-inline void Parkspace_info::set_parkspace_id(::google::protobuf::int32 value) {
-  set_has_parkspace_id();
-  parkspace_id_ = value;
-  // @@protoc_insertion_point(field_set:message.Parkspace_info.parkspace_id)
+inline void Parkspace_info::set_parkingspace_index_id(::google::protobuf::int32 value) {
+  set_has_parkingspace_index_id();
+  parkingspace_index_id_ = value;
+  // @@protoc_insertion_point(field_set:message.Parkspace_info.parkingspace_index_id)
 }
 
-// optional int32 block_id = 2;
-inline bool Parkspace_info::has_block_id() const {
+// optional .message.Parkspace_type parkingspace_type = 2;
+inline bool Parkspace_info::has_parkingspace_type() const {
+  return (_has_bits_[0] & 0x00002000u) != 0;
+}
+inline void Parkspace_info::set_has_parkingspace_type() {
+  _has_bits_[0] |= 0x00002000u;
+}
+inline void Parkspace_info::clear_has_parkingspace_type() {
+  _has_bits_[0] &= ~0x00002000u;
+}
+inline void Parkspace_info::clear_parkingspace_type() {
+  parkingspace_type_ = 1;
+  clear_has_parkingspace_type();
+}
+inline ::message::Parkspace_type Parkspace_info::parkingspace_type() const {
+  // @@protoc_insertion_point(field_get:message.Parkspace_info.parkingspace_type)
+  return static_cast< ::message::Parkspace_type >(parkingspace_type_);
+}
+inline void Parkspace_info::set_parkingspace_type(::message::Parkspace_type value) {
+  assert(::message::Parkspace_type_IsValid(value));
+  set_has_parkingspace_type();
+  parkingspace_type_ = value;
+  // @@protoc_insertion_point(field_set:message.Parkspace_info.parkingspace_type)
+}
+
+// optional int32 parkingspace_unit_id = 3;
+inline bool Parkspace_info::has_parkingspace_unit_id() const {
   return (_has_bits_[0] & 0x00000010u) != 0;
 }
-inline void Parkspace_info::set_has_block_id() {
+inline void Parkspace_info::set_has_parkingspace_unit_id() {
   _has_bits_[0] |= 0x00000010u;
 }
-inline void Parkspace_info::clear_has_block_id() {
+inline void Parkspace_info::clear_has_parkingspace_unit_id() {
   _has_bits_[0] &= ~0x00000010u;
 }
-inline void Parkspace_info::clear_block_id() {
-  block_id_ = 0;
-  clear_has_block_id();
+inline void Parkspace_info::clear_parkingspace_unit_id() {
+  parkingspace_unit_id_ = 0;
+  clear_has_parkingspace_unit_id();
 }
-inline ::google::protobuf::int32 Parkspace_info::block_id() const {
-  // @@protoc_insertion_point(field_get:message.Parkspace_info.block_id)
-  return block_id_;
+inline ::google::protobuf::int32 Parkspace_info::parkingspace_unit_id() const {
+  // @@protoc_insertion_point(field_get:message.Parkspace_info.parkingspace_unit_id)
+  return parkingspace_unit_id_;
 }
-inline void Parkspace_info::set_block_id(::google::protobuf::int32 value) {
-  set_has_block_id();
-  block_id_ = value;
-  // @@protoc_insertion_point(field_set:message.Parkspace_info.block_id)
+inline void Parkspace_info::set_parkingspace_unit_id(::google::protobuf::int32 value) {
+  set_has_parkingspace_unit_id();
+  parkingspace_unit_id_ = value;
+  // @@protoc_insertion_point(field_set:message.Parkspace_info.parkingspace_unit_id)
 }
 
-// optional int32 index = 3;
-inline bool Parkspace_info::has_index() const {
+// optional int32 parkingspace_room_id = 4;
+inline bool Parkspace_info::has_parkingspace_room_id() const {
   return (_has_bits_[0] & 0x00000020u) != 0;
 }
-inline void Parkspace_info::set_has_index() {
+inline void Parkspace_info::set_has_parkingspace_room_id() {
   _has_bits_[0] |= 0x00000020u;
 }
-inline void Parkspace_info::clear_has_index() {
+inline void Parkspace_info::clear_has_parkingspace_room_id() {
   _has_bits_[0] &= ~0x00000020u;
 }
-inline void Parkspace_info::clear_index() {
-  index_ = 0;
-  clear_has_index();
+inline void Parkspace_info::clear_parkingspace_room_id() {
+  parkingspace_room_id_ = 0;
+  clear_has_parkingspace_room_id();
 }
-inline ::google::protobuf::int32 Parkspace_info::index() const {
-  // @@protoc_insertion_point(field_get:message.Parkspace_info.index)
-  return index_;
+inline ::google::protobuf::int32 Parkspace_info::parkingspace_room_id() const {
+  // @@protoc_insertion_point(field_get:message.Parkspace_info.parkingspace_room_id)
+  return parkingspace_room_id_;
 }
-inline void Parkspace_info::set_index(::google::protobuf::int32 value) {
-  set_has_index();
-  index_ = value;
-  // @@protoc_insertion_point(field_set:message.Parkspace_info.index)
+inline void Parkspace_info::set_parkingspace_room_id(::google::protobuf::int32 value) {
+  set_has_parkingspace_room_id();
+  parkingspace_room_id_ = value;
+  // @@protoc_insertion_point(field_set:message.Parkspace_info.parkingspace_room_id)
 }
 
-// optional .message.Direction direction = 4;
-inline bool Parkspace_info::has_direction() const {
-  return (_has_bits_[0] & 0x00000800u) != 0;
+// optional .message.Direction parkingspace_direction = 5;
+inline bool Parkspace_info::has_parkingspace_direction() const {
+  return (_has_bits_[0] & 0x00004000u) != 0;
 }
-inline void Parkspace_info::set_has_direction() {
-  _has_bits_[0] |= 0x00000800u;
+inline void Parkspace_info::set_has_parkingspace_direction() {
+  _has_bits_[0] |= 0x00004000u;
 }
-inline void Parkspace_info::clear_has_direction() {
-  _has_bits_[0] &= ~0x00000800u;
+inline void Parkspace_info::clear_has_parkingspace_direction() {
+  _has_bits_[0] &= ~0x00004000u;
 }
-inline void Parkspace_info::clear_direction() {
-  direction_ = 1;
-  clear_has_direction();
+inline void Parkspace_info::clear_parkingspace_direction() {
+  parkingspace_direction_ = 1;
+  clear_has_parkingspace_direction();
 }
-inline ::message::Direction Parkspace_info::direction() const {
-  // @@protoc_insertion_point(field_get:message.Parkspace_info.direction)
-  return static_cast< ::message::Direction >(direction_);
+inline ::message::Direction Parkspace_info::parkingspace_direction() const {
+  // @@protoc_insertion_point(field_get:message.Parkspace_info.parkingspace_direction)
+  return static_cast< ::message::Direction >(parkingspace_direction_);
 }
-inline void Parkspace_info::set_direction(::message::Direction value) {
+inline void Parkspace_info::set_parkingspace_direction(::message::Direction value) {
   assert(::message::Direction_IsValid(value));
-  set_has_direction();
-  direction_ = value;
-  // @@protoc_insertion_point(field_set:message.Parkspace_info.direction)
+  set_has_parkingspace_direction();
+  parkingspace_direction_ = value;
+  // @@protoc_insertion_point(field_set:message.Parkspace_info.parkingspace_direction)
 }
 
-// optional int32 floor = 5;
-inline bool Parkspace_info::has_floor() const {
+// optional int32 parkingspace_floor_id = 6;
+inline bool Parkspace_info::has_parkingspace_floor_id() const {
   return (_has_bits_[0] & 0x00000040u) != 0;
 }
-inline void Parkspace_info::set_has_floor() {
+inline void Parkspace_info::set_has_parkingspace_floor_id() {
   _has_bits_[0] |= 0x00000040u;
 }
-inline void Parkspace_info::clear_has_floor() {
+inline void Parkspace_info::clear_has_parkingspace_floor_id() {
   _has_bits_[0] &= ~0x00000040u;
 }
-inline void Parkspace_info::clear_floor() {
-  floor_ = 0;
-  clear_has_floor();
+inline void Parkspace_info::clear_parkingspace_floor_id() {
+  parkingspace_floor_id_ = 0;
+  clear_has_parkingspace_floor_id();
 }
-inline ::google::protobuf::int32 Parkspace_info::floor() const {
-  // @@protoc_insertion_point(field_get:message.Parkspace_info.floor)
-  return floor_;
+inline ::google::protobuf::int32 Parkspace_info::parkingspace_floor_id() const {
+  // @@protoc_insertion_point(field_get:message.Parkspace_info.parkingspace_floor_id)
+  return parkingspace_floor_id_;
 }
-inline void Parkspace_info::set_floor(::google::protobuf::int32 value) {
-  set_has_floor();
-  floor_ = value;
-  // @@protoc_insertion_point(field_set:message.Parkspace_info.floor)
+inline void Parkspace_info::set_parkingspace_floor_id(::google::protobuf::int32 value) {
+  set_has_parkingspace_floor_id();
+  parkingspace_floor_id_ = value;
+  // @@protoc_insertion_point(field_set:message.Parkspace_info.parkingspace_floor_id)
 }
 
-// optional float length = 6;
-inline bool Parkspace_info::has_length() const {
+// optional float parkingspace_width = 7;
+inline bool Parkspace_info::has_parkingspace_width() const {
   return (_has_bits_[0] & 0x00000080u) != 0;
 }
-inline void Parkspace_info::set_has_length() {
+inline void Parkspace_info::set_has_parkingspace_width() {
   _has_bits_[0] |= 0x00000080u;
 }
-inline void Parkspace_info::clear_has_length() {
+inline void Parkspace_info::clear_has_parkingspace_width() {
   _has_bits_[0] &= ~0x00000080u;
 }
-inline void Parkspace_info::clear_length() {
-  length_ = 0;
-  clear_has_length();
+inline void Parkspace_info::clear_parkingspace_width() {
+  parkingspace_width_ = 0;
+  clear_has_parkingspace_width();
 }
-inline float Parkspace_info::length() const {
-  // @@protoc_insertion_point(field_get:message.Parkspace_info.length)
-  return length_;
+inline float Parkspace_info::parkingspace_width() const {
+  // @@protoc_insertion_point(field_get:message.Parkspace_info.parkingspace_width)
+  return parkingspace_width_;
 }
-inline void Parkspace_info::set_length(float value) {
-  set_has_length();
-  length_ = value;
-  // @@protoc_insertion_point(field_set:message.Parkspace_info.length)
+inline void Parkspace_info::set_parkingspace_width(float value) {
+  set_has_parkingspace_width();
+  parkingspace_width_ = value;
+  // @@protoc_insertion_point(field_set:message.Parkspace_info.parkingspace_width)
 }
 
-// optional float width = 7;
-inline bool Parkspace_info::has_width() const {
+// optional float parkingspace_height = 8;
+inline bool Parkspace_info::has_parkingspace_height() const {
   return (_has_bits_[0] & 0x00000100u) != 0;
 }
-inline void Parkspace_info::set_has_width() {
+inline void Parkspace_info::set_has_parkingspace_height() {
   _has_bits_[0] |= 0x00000100u;
 }
-inline void Parkspace_info::clear_has_width() {
+inline void Parkspace_info::clear_has_parkingspace_height() {
   _has_bits_[0] &= ~0x00000100u;
 }
-inline void Parkspace_info::clear_width() {
-  width_ = 0;
-  clear_has_width();
+inline void Parkspace_info::clear_parkingspace_height() {
+  parkingspace_height_ = 0;
+  clear_has_parkingspace_height();
 }
-inline float Parkspace_info::width() const {
-  // @@protoc_insertion_point(field_get:message.Parkspace_info.width)
-  return width_;
+inline float Parkspace_info::parkingspace_height() const {
+  // @@protoc_insertion_point(field_get:message.Parkspace_info.parkingspace_height)
+  return parkingspace_height_;
 }
-inline void Parkspace_info::set_width(float value) {
-  set_has_width();
-  width_ = value;
-  // @@protoc_insertion_point(field_set:message.Parkspace_info.width)
+inline void Parkspace_info::set_parkingspace_height(float value) {
+  set_has_parkingspace_height();
+  parkingspace_height_ = value;
+  // @@protoc_insertion_point(field_set:message.Parkspace_info.parkingspace_height)
 }
 
-// optional float height = 8;
-inline bool Parkspace_info::has_height() const {
+// optional .message.Parkspace_status parkingspace_status = 9;
+inline bool Parkspace_info::has_parkingspace_status() const {
   return (_has_bits_[0] & 0x00000200u) != 0;
 }
-inline void Parkspace_info::set_has_height() {
+inline void Parkspace_info::set_has_parkingspace_status() {
   _has_bits_[0] |= 0x00000200u;
 }
-inline void Parkspace_info::clear_has_height() {
+inline void Parkspace_info::clear_has_parkingspace_status() {
   _has_bits_[0] &= ~0x00000200u;
 }
-inline void Parkspace_info::clear_height() {
-  height_ = 0;
-  clear_has_height();
+inline void Parkspace_info::clear_parkingspace_status() {
+  parkingspace_status_ = 0;
+  clear_has_parkingspace_status();
 }
-inline float Parkspace_info::height() const {
-  // @@protoc_insertion_point(field_get:message.Parkspace_info.height)
-  return height_;
-}
-inline void Parkspace_info::set_height(float value) {
-  set_has_height();
-  height_ = value;
-  // @@protoc_insertion_point(field_set:message.Parkspace_info.height)
-}
-
-// optional .message.Parkspace_status parkspace_status = 9;
-inline bool Parkspace_info::has_parkspace_status() const {
-  return (_has_bits_[0] & 0x00000400u) != 0;
+inline ::message::Parkspace_status Parkspace_info::parkingspace_status() const {
+  // @@protoc_insertion_point(field_get:message.Parkspace_info.parkingspace_status)
+  return static_cast< ::message::Parkspace_status >(parkingspace_status_);
 }
-inline void Parkspace_info::set_has_parkspace_status() {
-  _has_bits_[0] |= 0x00000400u;
-}
-inline void Parkspace_info::clear_has_parkspace_status() {
-  _has_bits_[0] &= ~0x00000400u;
-}
-inline void Parkspace_info::clear_parkspace_status() {
-  parkspace_status_ = 0;
-  clear_has_parkspace_status();
-}
-inline ::message::Parkspace_status Parkspace_info::parkspace_status() const {
-  // @@protoc_insertion_point(field_get:message.Parkspace_info.parkspace_status)
-  return static_cast< ::message::Parkspace_status >(parkspace_status_);
-}
-inline void Parkspace_info::set_parkspace_status(::message::Parkspace_status value) {
+inline void Parkspace_info::set_parkingspace_status(::message::Parkspace_status value) {
   assert(::message::Parkspace_status_IsValid(value));
-  set_has_parkspace_status();
-  parkspace_status_ = value;
-  // @@protoc_insertion_point(field_set:message.Parkspace_info.parkspace_status)
+  set_has_parkingspace_status();
+  parkingspace_status_ = value;
+  // @@protoc_insertion_point(field_set:message.Parkspace_info.parkingspace_status)
 }
 
 // optional .message.Car_info car_info = 10;
@@ -2306,6 +2378,80 @@ inline void Parkspace_info::set_allocated_leave_time(::std::string* leave_time)
   // @@protoc_insertion_point(field_set_allocated:message.Parkspace_info.leave_time)
 }
 
+// optional .message.Parkspace_path parkspace_path = 13;
+inline bool Parkspace_info::has_parkspace_path() const {
+  return (_has_bits_[0] & 0x00001000u) != 0;
+}
+inline void Parkspace_info::set_has_parkspace_path() {
+  _has_bits_[0] |= 0x00001000u;
+}
+inline void Parkspace_info::clear_has_parkspace_path() {
+  _has_bits_[0] &= ~0x00001000u;
+}
+inline void Parkspace_info::clear_parkspace_path() {
+  parkspace_path_ = 1;
+  clear_has_parkspace_path();
+}
+inline ::message::Parkspace_path Parkspace_info::parkspace_path() const {
+  // @@protoc_insertion_point(field_get:message.Parkspace_info.parkspace_path)
+  return static_cast< ::message::Parkspace_path >(parkspace_path_);
+}
+inline void Parkspace_info::set_parkspace_path(::message::Parkspace_path value) {
+  assert(::message::Parkspace_path_IsValid(value));
+  set_has_parkspace_path();
+  parkspace_path_ = value;
+  // @@protoc_insertion_point(field_set:message.Parkspace_info.parkspace_path)
+}
+
+// optional float path_estimate_time = 14;
+inline bool Parkspace_info::has_path_estimate_time() const {
+  return (_has_bits_[0] & 0x00000400u) != 0;
+}
+inline void Parkspace_info::set_has_path_estimate_time() {
+  _has_bits_[0] |= 0x00000400u;
+}
+inline void Parkspace_info::clear_has_path_estimate_time() {
+  _has_bits_[0] &= ~0x00000400u;
+}
+inline void Parkspace_info::clear_path_estimate_time() {
+  path_estimate_time_ = 0;
+  clear_has_path_estimate_time();
+}
+inline float Parkspace_info::path_estimate_time() const {
+  // @@protoc_insertion_point(field_get:message.Parkspace_info.path_estimate_time)
+  return path_estimate_time_;
+}
+inline void Parkspace_info::set_path_estimate_time(float value) {
+  set_has_path_estimate_time();
+  path_estimate_time_ = value;
+  // @@protoc_insertion_point(field_set:message.Parkspace_info.path_estimate_time)
+}
+
+// optional .message.Parkspace_status parkspace_status_target = 15;
+inline bool Parkspace_info::has_parkspace_status_target() const {
+  return (_has_bits_[0] & 0x00000800u) != 0;
+}
+inline void Parkspace_info::set_has_parkspace_status_target() {
+  _has_bits_[0] |= 0x00000800u;
+}
+inline void Parkspace_info::clear_has_parkspace_status_target() {
+  _has_bits_[0] &= ~0x00000800u;
+}
+inline void Parkspace_info::clear_parkspace_status_target() {
+  parkspace_status_target_ = 0;
+  clear_has_parkspace_status_target();
+}
+inline ::message::Parkspace_status Parkspace_info::parkspace_status_target() const {
+  // @@protoc_insertion_point(field_get:message.Parkspace_info.parkspace_status_target)
+  return static_cast< ::message::Parkspace_status >(parkspace_status_target_);
+}
+inline void Parkspace_info::set_parkspace_status_target(::message::Parkspace_status value) {
+  assert(::message::Parkspace_status_IsValid(value));
+  set_has_parkspace_status_target();
+  parkspace_status_target_ = value;
+  // @@protoc_insertion_point(field_set:message.Parkspace_info.parkspace_status_target)
+}
+
 #ifdef __GNUC__
   #pragma GCC diagnostic pop
 #endif  // __GNUC__
@@ -2357,6 +2503,16 @@ template <>
 inline const EnumDescriptor* GetEnumDescriptor< ::message::Direction>() {
   return ::message::Direction_descriptor();
 }
+template <> struct is_proto_enum< ::message::Parkspace_path> : ::google::protobuf::internal::true_type {};
+template <>
+inline const EnumDescriptor* GetEnumDescriptor< ::message::Parkspace_path>() {
+  return ::message::Parkspace_path_descriptor();
+}
+template <> struct is_proto_enum< ::message::Parkspace_type> : ::google::protobuf::internal::true_type {};
+template <>
+inline const EnumDescriptor* GetEnumDescriptor< ::message::Parkspace_type>() {
+  return ::message::Parkspace_type_descriptor();
+}
 template <> struct is_proto_enum< ::message::Step_type> : ::google::protobuf::internal::true_type {};
 template <>
 inline const EnumDescriptor* GetEnumDescriptor< ::message::Step_type>() {

+ 36 - 12
message/message_base.proto

@@ -151,21 +151,45 @@ enum Direction
     eBackward = 2;
 }
 
+//车位分配路线(根据中跑车的路线来定)
+enum Parkspace_path
+{
+    OPTIMAL_PATH = 1;
+    LEFT_PATH = 2;
+    RIGHT_PATH = 3;
+    TEMPORARY_CACHE_PATH = 4;
+
+}
+//车位类型
+enum Parkspace_type
+{
+    MIN_PARKINGSPACE = 1;//小车位
+    MID_PARKINGSPACE = 2;//中车位
+    BIG_PARKINGSPACE = 3;//大车位
+}
+
 //单个车位基本信息与状态信息,车位信息以及车位上的车辆信息
 message Parkspace_info
 {
-    optional int32              parkspace_id=1;         //车位编号
-    optional int32              block_id=2;             //车位区块号
-    optional int32              index=3;                //同层编号
-    optional Direction          direction=4;            //前后
-    optional int32              floor=5;                //楼层
-    optional float              length=6;               //车位长
-    optional float              width=7;                //车位宽
-    optional float              height=8;               //车位高
-    optional Parkspace_status   parkspace_status=9;     //车位当前状态
-    optional Car_info           car_info=10;              //当前车位存入车辆的凭证号
-    optional string             entry_time=11;          //入场时间
-    optional string             leave_time=12;          //离场时间
+    optional int32              parkingspace_index_id = 1;            //车位ID
+    optional Parkspace_type     parkingspace_type = 2;                //车位类型
+    optional int32              parkingspace_unit_id = 3;            //车位单元号
+    optional int32              parkingspace_room_id = 4;             //同层编号
+    optional Direction          parkingspace_direction = 5;           //前后
+    optional int32              parkingspace_floor_id = 6;            //楼层
+    optional float              parkingspace_width = 7;               //车位宽
+    optional float              parkingspace_height = 8;              //车位高
+    optional Parkspace_status   parkingspace_status = 9;              //车位当前状态
+    optional Car_info           car_info = 10;                        //当前车位存入车辆的凭证号
+    optional string             entry_time = 11;                      //入场时间
+    optional string             leave_time = 12;                      //离场时间
+
+
+
+    optional Parkspace_path     parkspace_path = 13;            // 车位分配路线
+    optional float              path_estimate_time = 14;        //车位分配路线 time(s)
+    optional Parkspace_status   parkspace_status_target=15;     //车位目标状态
+
 }
 
 /*

+ 168 - 71
message/parkspace_allocation_message.pb.cc

@@ -417,10 +417,12 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUT
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Parkspace_allocation_response_msg, command_key_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Parkspace_allocation_response_msg, error_manager_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Parkspace_allocation_response_msg, allocated_space_info_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Parkspace_allocation_response_msg, allocated_space_info_ex_),
   1,
   0,
   2,
   3,
+  ~0u,
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Parkspace_search_request_msg, _has_bits_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Parkspace_search_request_msg, _internal_metadata_),
   ~0u,  // no _extensions_
@@ -501,9 +503,11 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUT
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Parkspace_confirm_alloc_request_msg, base_info_),
   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_space_info_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Parkspace_confirm_alloc_request_msg, confirm_space_info_ex_),
   1,
   0,
   2,
+  ~0u,
   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_),
   ~0u,  // no _extensions_
@@ -551,18 +555,18 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUT
 };
 static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
   { 0, 9, sizeof(::message::Parkspace_allocation_request_msg)},
-  { 13, 22, sizeof(::message::Parkspace_allocation_response_msg)},
-  { 26, 34, sizeof(::message::Parkspace_search_request_msg)},
-  { 37, 46, sizeof(::message::Parkspace_search_response_msg)},
-  { 50, 58, sizeof(::message::Parkspace_release_request_msg)},
-  { 61, 70, sizeof(::message::Parkspace_release_response_msg)},
-  { 74, 82, sizeof(::message::Parkspace_force_update_request_msg)},
-  { 85, 94, sizeof(::message::Parkspace_force_update_response_msg)},
-  { 98, 106, sizeof(::message::Parkspace_confirm_alloc_request_msg)},
-  { 109, 118, sizeof(::message::Parkspace_confirm_alloc_response_msg)},
-  { 122, 131, sizeof(::message::Parkspace_allocation_status_msg)},
-  { 135, 141, sizeof(::message::Parkspace_refresh_request_msg)},
-  { 142, 150, sizeof(::message::Parkspace_allocation_data_msg)},
+  { 13, 23, sizeof(::message::Parkspace_allocation_response_msg)},
+  { 28, 36, sizeof(::message::Parkspace_search_request_msg)},
+  { 39, 48, sizeof(::message::Parkspace_search_response_msg)},
+  { 52, 60, sizeof(::message::Parkspace_release_request_msg)},
+  { 63, 72, sizeof(::message::Parkspace_release_response_msg)},
+  { 76, 84, sizeof(::message::Parkspace_force_update_request_msg)},
+  { 87, 96, sizeof(::message::Parkspace_force_update_response_msg)},
+  { 100, 109, sizeof(::message::Parkspace_confirm_alloc_request_msg)},
+  { 113, 122, sizeof(::message::Parkspace_confirm_alloc_response_msg)},
+  { 126, 135, sizeof(::message::Parkspace_allocation_status_msg)},
+  { 139, 145, sizeof(::message::Parkspace_refresh_request_msg)},
+  { 146, 154, sizeof(::message::Parkspace_allocation_data_msg)},
 };
 
 static ::google::protobuf::Message const * const file_default_instances[] = {
@@ -608,71 +612,74 @@ void AddDescriptorsImpl() {
       "allocation_request_msg\022%\n\tbase_info\030\001 \002("
       "\0132\022.message.Base_info\022\023\n\013command_key\030\002 \002"
       "(\t\022#\n\010car_info\030\003 \002(\0132\021.message.Car_info\022"
-      "\023\n\013terminal_id\030\004 \002(\005\"\305\001\n!Parkspace_alloc"
+      "\023\n\013terminal_id\030\004 \002(\005\"\377\001\n!Parkspace_alloc"
       "ation_response_msg\022%\n\tbase_info\030\001 \002(\0132\022."
       "message.Base_info\022\023\n\013command_key\030\002 \002(\t\022-"
       "\n\rerror_manager\030\003 \002(\0132\026.message.Error_ma"
       "nager\0225\n\024allocated_space_info\030\004 \002(\0132\027.me"
-      "ssage.Parkspace_info\"\177\n\034Parkspace_search"
-      "_request_msg\022%\n\tbase_info\030\001 \002(\0132\022.messag"
-      "e.Base_info\022\023\n\013command_key\030\002 \002(\t\022#\n\010car_"
-      "info\030\003 \002(\0132\021.message.Car_info\"\271\001\n\035Parksp"
-      "ace_search_response_msg\022%\n\tbase_info\030\001 \002"
-      "(\0132\022.message.Base_info\022\023\n\013command_key\030\002 "
-      "\002(\t\022-\n\rerror_manager\030\003 \002(\0132\026.message.Err"
-      "or_manager\022-\n\014car_position\030\004 \001(\0132\027.messa"
-      "ge.Parkspace_info\"\220\001\n\035Parkspace_release_"
-      "request_msg\022%\n\tbase_info\030\001 \002(\0132\022.message"
-      ".Base_info\022\023\n\013command_key\030\002 \002(\t\0223\n\022relea"
-      "se_space_info\030\003 \002(\0132\027.message.Parkspace_"
-      "info\"\300\001\n\036Parkspace_release_response_msg\022"
-      "%\n\tbase_info\030\001 \002(\0132\022.message.Base_info\022\023"
-      "\n\013command_key\030\002 \002(\t\022-\n\rerror_manager\030\003 \002"
-      "(\0132\026.message.Error_manager\0223\n\022release_sp"
-      "ace_info\030\004 \002(\0132\027.message.Parkspace_info\""
-      "\224\001\n\"Parkspace_force_update_request_msg\022%"
-      "\n\tbase_info\030\001 \002(\0132\022.message.Base_info\022\023\n"
-      "\013command_key\030\002 \002(\t\0222\n\021update_space_info\030"
-      "\003 \002(\0132\027.message.Parkspace_info\"\304\001\n#Parks"
-      "pace_force_update_response_msg\022%\n\tbase_i"
+      "ssage.Parkspace_info\0228\n\027allocated_space_"
+      "info_ex\030\005 \003(\0132\027.message.Parkspace_info\"\177"
+      "\n\034Parkspace_search_request_msg\022%\n\tbase_i"
       "nfo\030\001 \002(\0132\022.message.Base_info\022\023\n\013command"
-      "_key\030\002 \002(\t\022-\n\rerror_manager\030\003 \002(\0132\026.mess"
-      "age.Error_manager\0222\n\021update_space_info\030\004"
-      " \002(\0132\027.message.Parkspace_info\"\226\001\n#Parksp"
-      "ace_confirm_alloc_request_msg\022%\n\tbase_in"
+      "_key\030\002 \002(\t\022#\n\010car_info\030\003 \002(\0132\021.message.C"
+      "ar_info\"\271\001\n\035Parkspace_search_response_ms"
+      "g\022%\n\tbase_info\030\001 \002(\0132\022.message.Base_info"
+      "\022\023\n\013command_key\030\002 \002(\t\022-\n\rerror_manager\030\003"
+      " \002(\0132\026.message.Error_manager\022-\n\014car_posi"
+      "tion\030\004 \001(\0132\027.message.Parkspace_info\"\220\001\n\035"
+      "Parkspace_release_request_msg\022%\n\tbase_in"
       "fo\030\001 \002(\0132\022.message.Base_info\022\023\n\013command_"
-      "key\030\002 \002(\t\0223\n\022confirm_space_info\030\003 \002(\0132\027."
-      "message.Parkspace_info\"\314\001\n$Parkspace_con"
-      "firm_alloc_response_msg\022%\n\tbase_info\030\001 \002"
-      "(\0132\022.message.Base_info\022\023\n\013command_key\030\002 "
-      "\002(\t\022-\n\rerror_manager\030\003 \002(\0132\026.message.Err"
-      "or_manager\0229\n\030confirm_alloc_space_info\030\004"
-      " \002(\0132\027.message.Parkspace_info\"\203\002\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\"F\n\035Parkspace_refresh_request"
-      "_msg\022%\n\tbase_info\030\001 \002(\0132\022.message.Base_i"
-      "nfo\"\246\001\n\035Parkspace_allocation_data_msg\022%\n"
-      "\tbase_info\030\001 \002(\0132\022.message.Base_info\022-\n\r"
-      "error_manager\030\002 \002(\0132\026.message.Error_mana"
-      "ger\022/\n\016parkspace_info\030\003 \003(\0132\027.message.Pa"
-      "rkspace_info*\225\001\n\016Vehicle_status\022\021\n\reVehi"
-      "cle_idle\020\000\022\026\n\022eVehicle_in_garage\020\001\022\024\n\020eV"
-      "ehicle_parking\020\002\022\025\n\021eVehicle_fetching\020\003\022"
-      "\025\n\021eVehicle_reserved\020\004\022\024\n\020eVehicle_unkno"
-      "wn\020\005*W\n\032Database_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\032eParkspace_manager_unknown\020\000\022\035\n\031ePar"
-      "kspace_manager_normal\020\001\022\034\n\030eParkspace_ma"
-      "nager_fault\020\002"
+      "key\030\002 \002(\t\0223\n\022release_space_info\030\003 \002(\0132\027."
+      "message.Parkspace_info\"\300\001\n\036Parkspace_rel"
+      "ease_response_msg\022%\n\tbase_info\030\001 \002(\0132\022.m"
+      "essage.Base_info\022\023\n\013command_key\030\002 \002(\t\022-\n"
+      "\rerror_manager\030\003 \002(\0132\026.message.Error_man"
+      "ager\0223\n\022release_space_info\030\004 \002(\0132\027.messa"
+      "ge.Parkspace_info\"\224\001\n\"Parkspace_force_up"
+      "date_request_msg\022%\n\tbase_info\030\001 \002(\0132\022.me"
+      "ssage.Base_info\022\023\n\013command_key\030\002 \002(\t\0222\n\021"
+      "update_space_info\030\003 \002(\0132\027.message.Parksp"
+      "ace_info\"\304\001\n#Parkspace_force_update_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\0222\n\021u"
+      "pdate_space_info\030\004 \002(\0132\027.message.Parkspa"
+      "ce_info\"\316\001\n#Parkspace_confirm_alloc_requ"
+      "est_msg\022%\n\tbase_info\030\001 \002(\0132\022.message.Bas"
+      "e_info\022\023\n\013command_key\030\002 \002(\t\0223\n\022confirm_s"
+      "pace_info\030\003 \002(\0132\027.message.Parkspace_info"
+      "\0226\n\025confirm_space_info_ex\030\004 \003(\0132\027.messag"
+      "e.Parkspace_info\"\314\001\n$Parkspace_confirm_a"
+      "lloc_response_msg\022%\n\tbase_info\030\001 \002(\0132\022.m"
+      "essage.Base_info\022\023\n\013command_key\030\002 \002(\t\022-\n"
+      "\rerror_manager\030\003 \002(\0132\026.message.Error_man"
+      "ager\0229\n\030confirm_alloc_space_info\030\004 \002(\0132\027"
+      ".message.Parkspace_info\"\203\002\n\037Parkspace_al"
+      "location_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_co"
+      "ntroller_status\030\003 \002(\0162#.message.Database"
+      "_controller_status\022A\n\027parkspace_manager_"
+      "satus\030\004 \002(\0162 .message.Parkspace_manager_"
+      "satus\"F\n\035Parkspace_refresh_request_msg\022%"
+      "\n\tbase_info\030\001 \002(\0132\022.message.Base_info\"\246\001"
+      "\n\035Parkspace_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\022/\n"
+      "\016parkspace_info\030\003 \003(\0132\027.message.Parkspac"
+      "e_info*\225\001\n\016Vehicle_status\022\021\n\reVehicle_id"
+      "le\020\000\022\026\n\022eVehicle_in_garage\020\001\022\024\n\020eVehicle"
+      "_parking\020\002\022\025\n\021eVehicle_fetching\020\003\022\025\n\021eVe"
+      "hicle_reserved\020\004\022\024\n\020eVehicle_unknown\020\005*W"
+      "\n\032Database_controller_status\022\r\n\tE_UNKNOW"
+      "N\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\032eP"
+      "arkspace_manager_unknown\020\000\022\035\n\031eParkspace"
+      "_manager_normal\020\001\022\034\n\030eParkspace_manager_"
+      "fault\020\002"
   };
   ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
-      descriptor, 2653);
+      descriptor, 2767);
   ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
     "parkspace_allocation_message.proto", &protobuf_RegisterTypes);
   ::protobuf_message_5fbase_2eproto::AddDescriptors();
@@ -1214,11 +1221,15 @@ void Parkspace_allocation_response_msg::clear_allocated_space_info() {
   if (allocated_space_info_ != NULL) allocated_space_info_->Clear();
   clear_has_allocated_space_info();
 }
+void Parkspace_allocation_response_msg::clear_allocated_space_info_ex() {
+  allocated_space_info_ex_.Clear();
+}
 #if !defined(_MSC_VER) || _MSC_VER >= 1900
 const int Parkspace_allocation_response_msg::kBaseInfoFieldNumber;
 const int Parkspace_allocation_response_msg::kCommandKeyFieldNumber;
 const int Parkspace_allocation_response_msg::kErrorManagerFieldNumber;
 const int Parkspace_allocation_response_msg::kAllocatedSpaceInfoFieldNumber;
+const int Parkspace_allocation_response_msg::kAllocatedSpaceInfoExFieldNumber;
 #endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
 
 Parkspace_allocation_response_msg::Parkspace_allocation_response_msg()
@@ -1233,7 +1244,8 @@ Parkspace_allocation_response_msg::Parkspace_allocation_response_msg(const Parks
   : ::google::protobuf::Message(),
       _internal_metadata_(NULL),
       _has_bits_(from._has_bits_),
-      _cached_size_(0) {
+      _cached_size_(0),
+      allocated_space_info_ex_(from.allocated_space_info_ex_) {
   _internal_metadata_.MergeFrom(from._internal_metadata_);
   command_key_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
   if (from.has_command_key()) {
@@ -1306,6 +1318,7 @@ void Parkspace_allocation_response_msg::Clear() {
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
+  allocated_space_info_ex_.Clear();
   cached_has_bits = _has_bits_[0];
   if (cached_has_bits & 15u) {
     if (cached_has_bits & 0x00000001u) {
@@ -1391,6 +1404,17 @@ bool Parkspace_allocation_response_msg::MergePartialFromCodedStream(
         break;
       }
 
+      // repeated .message.Parkspace_info allocated_space_info_ex = 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, add_allocated_space_info_ex()));
+        } else {
+          goto handle_unusual;
+        }
+        break;
+      }
+
       default: {
       handle_unusual:
         if (tag == 0) {
@@ -1446,6 +1470,13 @@ void Parkspace_allocation_response_msg::SerializeWithCachedSizes(
       4, *this->allocated_space_info_, output);
   }
 
+  // repeated .message.Parkspace_info allocated_space_info_ex = 5;
+  for (unsigned int i = 0,
+      n = static_cast<unsigned int>(this->allocated_space_info_ex_size()); i < n; i++) {
+    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
+      5, this->allocated_space_info_ex(static_cast<int>(i)), output);
+  }
+
   if (_internal_metadata_.have_unknown_fields()) {
     ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
         _internal_metadata_.unknown_fields(), output);
@@ -1493,6 +1524,14 @@ void Parkspace_allocation_response_msg::SerializeWithCachedSizes(
         4, *this->allocated_space_info_, deterministic, target);
   }
 
+  // repeated .message.Parkspace_info allocated_space_info_ex = 5;
+  for (unsigned int i = 0,
+      n = static_cast<unsigned int>(this->allocated_space_info_ex_size()); i < n; i++) {
+    target = ::google::protobuf::internal::WireFormatLite::
+      InternalWriteMessageToArray(
+        5, this->allocated_space_info_ex(static_cast<int>(i)), deterministic, target);
+  }
+
   if (_internal_metadata_.have_unknown_fields()) {
     target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
         _internal_metadata_.unknown_fields(), target);
@@ -1568,6 +1607,17 @@ size_t Parkspace_allocation_response_msg::ByteSizeLong() const {
   } else {
     total_size += RequiredFieldsByteSizeFallback();
   }
+  // repeated .message.Parkspace_info allocated_space_info_ex = 5;
+  {
+    unsigned int count = static_cast<unsigned int>(this->allocated_space_info_ex_size());
+    total_size += 1UL * count;
+    for (unsigned int i = 0; i < count; i++) {
+      total_size +=
+        ::google::protobuf::internal::WireFormatLite::MessageSize(
+          this->allocated_space_info_ex(static_cast<int>(i)));
+    }
+  }
+
   int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
   GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
   _cached_size_ = cached_size;
@@ -1597,6 +1647,7 @@ void Parkspace_allocation_response_msg::MergeFrom(const Parkspace_allocation_res
   ::google::protobuf::uint32 cached_has_bits = 0;
   (void) cached_has_bits;
 
+  allocated_space_info_ex_.MergeFrom(from.allocated_space_info_ex_);
   cached_has_bits = from._has_bits_[0];
   if (cached_has_bits & 15u) {
     if (cached_has_bits & 0x00000001u) {
@@ -1646,6 +1697,7 @@ void Parkspace_allocation_response_msg::Swap(Parkspace_allocation_response_msg*
 }
 void Parkspace_allocation_response_msg::InternalSwap(Parkspace_allocation_response_msg* other) {
   using std::swap;
+  allocated_space_info_ex_.InternalSwap(&other->allocated_space_info_ex_);
   command_key_.Swap(&other->command_key_);
   swap(base_info_, other->base_info_);
   swap(error_manager_, other->error_manager_);
@@ -4303,10 +4355,14 @@ void Parkspace_confirm_alloc_request_msg::clear_confirm_space_info() {
   if (confirm_space_info_ != NULL) confirm_space_info_->Clear();
   clear_has_confirm_space_info();
 }
+void Parkspace_confirm_alloc_request_msg::clear_confirm_space_info_ex() {
+  confirm_space_info_ex_.Clear();
+}
 #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::kConfirmSpaceInfoFieldNumber;
+const int Parkspace_confirm_alloc_request_msg::kConfirmSpaceInfoExFieldNumber;
 #endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
 
 Parkspace_confirm_alloc_request_msg::Parkspace_confirm_alloc_request_msg()
@@ -4321,7 +4377,8 @@ Parkspace_confirm_alloc_request_msg::Parkspace_confirm_alloc_request_msg(const P
   : ::google::protobuf::Message(),
       _internal_metadata_(NULL),
       _has_bits_(from._has_bits_),
-      _cached_size_(0) {
+      _cached_size_(0),
+      confirm_space_info_ex_(from.confirm_space_info_ex_) {
   _internal_metadata_.MergeFrom(from._internal_metadata_);
   command_key_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
   if (from.has_command_key()) {
@@ -4388,6 +4445,7 @@ void Parkspace_confirm_alloc_request_msg::Clear() {
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
+  confirm_space_info_ex_.Clear();
   cached_has_bits = _has_bits_[0];
   if (cached_has_bits & 7u) {
     if (cached_has_bits & 0x00000001u) {
@@ -4457,6 +4515,17 @@ bool Parkspace_confirm_alloc_request_msg::MergePartialFromCodedStream(
         break;
       }
 
+      // repeated .message.Parkspace_info confirm_space_info_ex = 4;
+      case 4: {
+        if (static_cast< ::google::protobuf::uint8>(tag) ==
+            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
+          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_confirm_space_info_ex()));
+        } else {
+          goto handle_unusual;
+        }
+        break;
+      }
+
       default: {
       handle_unusual:
         if (tag == 0) {
@@ -4506,6 +4575,13 @@ void Parkspace_confirm_alloc_request_msg::SerializeWithCachedSizes(
       3, *this->confirm_space_info_, output);
   }
 
+  // repeated .message.Parkspace_info confirm_space_info_ex = 4;
+  for (unsigned int i = 0,
+      n = static_cast<unsigned int>(this->confirm_space_info_ex_size()); i < n; i++) {
+    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
+      4, this->confirm_space_info_ex(static_cast<int>(i)), output);
+  }
+
   if (_internal_metadata_.have_unknown_fields()) {
     ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
         _internal_metadata_.unknown_fields(), output);
@@ -4546,6 +4622,14 @@ void Parkspace_confirm_alloc_request_msg::SerializeWithCachedSizes(
         3, *this->confirm_space_info_, deterministic, target);
   }
 
+  // repeated .message.Parkspace_info confirm_space_info_ex = 4;
+  for (unsigned int i = 0,
+      n = static_cast<unsigned int>(this->confirm_space_info_ex_size()); i < n; i++) {
+    target = ::google::protobuf::internal::WireFormatLite::
+      InternalWriteMessageToArray(
+        4, this->confirm_space_info_ex(static_cast<int>(i)), deterministic, target);
+  }
+
   if (_internal_metadata_.have_unknown_fields()) {
     target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
         _internal_metadata_.unknown_fields(), target);
@@ -4609,6 +4693,17 @@ size_t Parkspace_confirm_alloc_request_msg::ByteSizeLong() const {
   } else {
     total_size += RequiredFieldsByteSizeFallback();
   }
+  // repeated .message.Parkspace_info confirm_space_info_ex = 4;
+  {
+    unsigned int count = static_cast<unsigned int>(this->confirm_space_info_ex_size());
+    total_size += 1UL * count;
+    for (unsigned int i = 0; i < count; i++) {
+      total_size +=
+        ::google::protobuf::internal::WireFormatLite::MessageSize(
+          this->confirm_space_info_ex(static_cast<int>(i)));
+    }
+  }
+
   int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
   GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
   _cached_size_ = cached_size;
@@ -4638,6 +4733,7 @@ void Parkspace_confirm_alloc_request_msg::MergeFrom(const Parkspace_confirm_allo
   ::google::protobuf::uint32 cached_has_bits = 0;
   (void) cached_has_bits;
 
+  confirm_space_info_ex_.MergeFrom(from.confirm_space_info_ex_);
   cached_has_bits = from._has_bits_[0];
   if (cached_has_bits & 7u) {
     if (cached_has_bits & 0x00000001u) {
@@ -4681,6 +4777,7 @@ void Parkspace_confirm_alloc_request_msg::Swap(Parkspace_confirm_alloc_request_m
 }
 void Parkspace_confirm_alloc_request_msg::InternalSwap(Parkspace_confirm_alloc_request_msg* other) {
   using std::swap;
+  confirm_space_info_ex_.InternalSwap(&other->confirm_space_info_ex_);
   command_key_.Swap(&other->command_key_);
   swap(base_info_, other->base_info_);
   swap(confirm_space_info_, other->confirm_space_info_);

+ 80 - 0
message/parkspace_allocation_message.pb.h

@@ -439,6 +439,18 @@ class Parkspace_allocation_response_msg : public ::google::protobuf::Message /*
 
   // accessors -------------------------------------------------------
 
+  // repeated .message.Parkspace_info allocated_space_info_ex = 5;
+  int allocated_space_info_ex_size() const;
+  void clear_allocated_space_info_ex();
+  static const int kAllocatedSpaceInfoExFieldNumber = 5;
+  const ::message::Parkspace_info& allocated_space_info_ex(int index) const;
+  ::message::Parkspace_info* mutable_allocated_space_info_ex(int index);
+  ::message::Parkspace_info* add_allocated_space_info_ex();
+  ::google::protobuf::RepeatedPtrField< ::message::Parkspace_info >*
+      mutable_allocated_space_info_ex();
+  const ::google::protobuf::RepeatedPtrField< ::message::Parkspace_info >&
+      allocated_space_info_ex() const;
+
   // required string command_key = 2;
   bool has_command_key() const;
   void clear_command_key();
@@ -498,6 +510,7 @@ class Parkspace_allocation_response_msg : public ::google::protobuf::Message /*
   ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
   ::google::protobuf::internal::HasBits<1> _has_bits_;
   mutable int _cached_size_;
+  ::google::protobuf::RepeatedPtrField< ::message::Parkspace_info > allocated_space_info_ex_;
   ::google::protobuf::internal::ArenaStringPtr command_key_;
   ::message::Base_info* base_info_;
   ::message::Error_manager* error_manager_;
@@ -1502,6 +1515,18 @@ class Parkspace_confirm_alloc_request_msg : public ::google::protobuf::Message /
 
   // accessors -------------------------------------------------------
 
+  // repeated .message.Parkspace_info confirm_space_info_ex = 4;
+  int confirm_space_info_ex_size() const;
+  void clear_confirm_space_info_ex();
+  static const int kConfirmSpaceInfoExFieldNumber = 4;
+  const ::message::Parkspace_info& confirm_space_info_ex(int index) const;
+  ::message::Parkspace_info* mutable_confirm_space_info_ex(int index);
+  ::message::Parkspace_info* add_confirm_space_info_ex();
+  ::google::protobuf::RepeatedPtrField< ::message::Parkspace_info >*
+      mutable_confirm_space_info_ex();
+  const ::google::protobuf::RepeatedPtrField< ::message::Parkspace_info >&
+      confirm_space_info_ex() const;
+
   // required string command_key = 2;
   bool has_command_key() const;
   void clear_command_key();
@@ -1550,6 +1575,7 @@ class Parkspace_confirm_alloc_request_msg : public ::google::protobuf::Message /
   ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
   ::google::protobuf::internal::HasBits<1> _has_bits_;
   mutable int _cached_size_;
+  ::google::protobuf::RepeatedPtrField< ::message::Parkspace_info > confirm_space_info_ex_;
   ::google::protobuf::internal::ArenaStringPtr command_key_;
   ::message::Base_info* base_info_;
   ::message::Parkspace_info* confirm_space_info_;
@@ -2527,6 +2553,33 @@ inline void Parkspace_allocation_response_msg::set_allocated_allocated_space_inf
   // @@protoc_insertion_point(field_set_allocated:message.Parkspace_allocation_response_msg.allocated_space_info)
 }
 
+// repeated .message.Parkspace_info allocated_space_info_ex = 5;
+inline int Parkspace_allocation_response_msg::allocated_space_info_ex_size() const {
+  return allocated_space_info_ex_.size();
+}
+inline const ::message::Parkspace_info& Parkspace_allocation_response_msg::allocated_space_info_ex(int index) const {
+  // @@protoc_insertion_point(field_get:message.Parkspace_allocation_response_msg.allocated_space_info_ex)
+  return allocated_space_info_ex_.Get(index);
+}
+inline ::message::Parkspace_info* Parkspace_allocation_response_msg::mutable_allocated_space_info_ex(int index) {
+  // @@protoc_insertion_point(field_mutable:message.Parkspace_allocation_response_msg.allocated_space_info_ex)
+  return allocated_space_info_ex_.Mutable(index);
+}
+inline ::message::Parkspace_info* Parkspace_allocation_response_msg::add_allocated_space_info_ex() {
+  // @@protoc_insertion_point(field_add:message.Parkspace_allocation_response_msg.allocated_space_info_ex)
+  return allocated_space_info_ex_.Add();
+}
+inline ::google::protobuf::RepeatedPtrField< ::message::Parkspace_info >*
+Parkspace_allocation_response_msg::mutable_allocated_space_info_ex() {
+  // @@protoc_insertion_point(field_mutable_list:message.Parkspace_allocation_response_msg.allocated_space_info_ex)
+  return &allocated_space_info_ex_;
+}
+inline const ::google::protobuf::RepeatedPtrField< ::message::Parkspace_info >&
+Parkspace_allocation_response_msg::allocated_space_info_ex() const {
+  // @@protoc_insertion_point(field_list:message.Parkspace_allocation_response_msg.allocated_space_info_ex)
+  return allocated_space_info_ex_;
+}
+
 // -------------------------------------------------------------------
 
 // Parkspace_search_request_msg
@@ -3846,6 +3899,33 @@ inline void Parkspace_confirm_alloc_request_msg::set_allocated_confirm_space_inf
   // @@protoc_insertion_point(field_set_allocated:message.Parkspace_confirm_alloc_request_msg.confirm_space_info)
 }
 
+// repeated .message.Parkspace_info confirm_space_info_ex = 4;
+inline int Parkspace_confirm_alloc_request_msg::confirm_space_info_ex_size() const {
+  return confirm_space_info_ex_.size();
+}
+inline const ::message::Parkspace_info& Parkspace_confirm_alloc_request_msg::confirm_space_info_ex(int index) const {
+  // @@protoc_insertion_point(field_get:message.Parkspace_confirm_alloc_request_msg.confirm_space_info_ex)
+  return confirm_space_info_ex_.Get(index);
+}
+inline ::message::Parkspace_info* Parkspace_confirm_alloc_request_msg::mutable_confirm_space_info_ex(int index) {
+  // @@protoc_insertion_point(field_mutable:message.Parkspace_confirm_alloc_request_msg.confirm_space_info_ex)
+  return confirm_space_info_ex_.Mutable(index);
+}
+inline ::message::Parkspace_info* Parkspace_confirm_alloc_request_msg::add_confirm_space_info_ex() {
+  // @@protoc_insertion_point(field_add:message.Parkspace_confirm_alloc_request_msg.confirm_space_info_ex)
+  return confirm_space_info_ex_.Add();
+}
+inline ::google::protobuf::RepeatedPtrField< ::message::Parkspace_info >*
+Parkspace_confirm_alloc_request_msg::mutable_confirm_space_info_ex() {
+  // @@protoc_insertion_point(field_mutable_list:message.Parkspace_confirm_alloc_request_msg.confirm_space_info_ex)
+  return &confirm_space_info_ex_;
+}
+inline const ::google::protobuf::RepeatedPtrField< ::message::Parkspace_info >&
+Parkspace_confirm_alloc_request_msg::confirm_space_info_ex() const {
+  // @@protoc_insertion_point(field_list:message.Parkspace_confirm_alloc_request_msg.confirm_space_info_ex)
+  return confirm_space_info_ex_;
+}
+
 // -------------------------------------------------------------------
 
 // Parkspace_confirm_alloc_response_msg

+ 5 - 1
message/parkspace_allocation_message.proto

@@ -52,6 +52,8 @@ message Parkspace_allocation_response_msg
     required string                     command_key=2;           //指令唯一标识符id
     required Error_manager              error_manager=3;        //分配成功与否标志
     required Parkspace_info             allocated_space_info=4; //分配车位信息
+
+    repeated Parkspace_info             allocated_space_info_ex = 5;    //分配车位信息
 }
 
 //2.查询车辆位置请求
@@ -105,12 +107,14 @@ message Parkspace_force_update_response_msg
     required Parkspace_info             update_space_info=4;    //已修改后的车位信息
 }
 
-// 5.临时锁定车位
+// 5.确认占有车位
 message Parkspace_confirm_alloc_request_msg
 {
     required Base_info                  base_info=1;            //消息类型
     required string                     command_key=2;           //指令唯一标识符id
     required Parkspace_info             confirm_space_info=3;    //已修改后的车位信息
+
+    repeated Parkspace_info             confirm_space_info_ex = 4;    //分配车位信息
 }
 
 message Parkspace_confirm_alloc_response_msg

+ 524 - 113
parkspace_allocation/parkspace_manager.cpp

@@ -96,7 +96,7 @@ Error_manager Parkspace_manager::execute_msg(Communication_message* p_msg)
         {
             message::Parkspace_release_request_msg request;
             bool result = request.ParseFromString(p_msg->get_message_buf());
-            LOG(INFO)<<"release request, parkspace id: "<<request.release_space_info().parkspace_id();
+            LOG(INFO)<<"release request, parkspace id: "<<request.release_space_info().parkingspace_index_id();
             if(!result)
             {
                 return Error_manager(Error_code::PARKSPACE_ALLOCATOR_MSG_PARSE_ERROR, Error_level::MINOR_ERROR,
@@ -113,7 +113,7 @@ Error_manager Parkspace_manager::execute_msg(Communication_message* p_msg)
         {
             message::Parkspace_force_update_request_msg request;
             bool result = request.ParseFromString(p_msg->get_message_buf());
-            LOG(INFO)<<"force update request, parkspace id: "<<request.update_space_info().parkspace_id();
+            LOG(INFO)<<"force update request, parkspace id: "<<request.update_space_info().parkingspace_index_id();
             if(!result)
             {
                 return Error_manager(Error_code::PARKSPACE_ALLOCATOR_MSG_PARSE_ERROR, Error_level::MINOR_ERROR,
@@ -131,7 +131,7 @@ Error_manager Parkspace_manager::execute_msg(Communication_message* p_msg)
             message::Parkspace_confirm_alloc_request_msg request;
             bool result = request.ParseFromString(p_msg->get_message_buf());
 
-            LOG(INFO)<<"confirm alloc request, parkspace id: "<<request.confirm_space_info().parkspace_id();
+            LOG(INFO)<<"confirm alloc request, parkspace id: "<<request.confirm_space_info().parkingspace_index_id();
             if(!result)
             {
                 return Error_manager(Error_code::PARKSPACE_ALLOCATOR_MSG_PARSE_ERROR, Error_level::MINOR_ERROR,
@@ -229,9 +229,8 @@ Error_manager Parkspace_manager::send_parkspace_data()
 
 	return Parkspace_communicator::get_instance_references().encapsulate_msg(all_parkspace_data.SerializeAsString());
 }
-
-//找到一个最优车位
-Error_manager Parkspace_manager::query_the_optimal_parkspace(message::Parkspace_info &parkspace_info,message::Car_info car_info,int terminal_id)
+//找到一个最优车位---方案一
+Error_manager Parkspace_manager::query_the_optimal_parkspace_serverA(message::Parkspace_info &parkspace_info,message::Car_info car_info,int terminal_id)
 {
 	//车辆高大于1550mm分在四楼以下,小于1550mm分在四楼以上
 	/*
@@ -239,184 +238,589 @@ Error_manager Parkspace_manager::query_the_optimal_parkspace(message::Parkspace_
 	 * P=i%6
 	 * S=15*d-(j%15)*(2*d-1)+[6*d-(i%6)(2*d-1)]*W    W>1
 	 */
-	message::Parkspace_allocation_data_msg all_parkspace_data;
-	Error_manager t_error=m_parkspace_operating_function.get_all_parkspace_info(all_parkspace_data);
-	if(t_error != SUCCESS)
-	{
-		return t_error;
-	}
 	int time_min=0;
-	int parkspace_id=0;
-	if( car_info.car_height() > CAR_HIGH_STANDARDS )
+	int parkingspace_index_id=-1;
+	//判断是否是左半库
+	if ( terminal_id<=3 && terminal_id>=0)
 	{
-		//计算四楼以下最优车位
-		int i=0;
-		while (i<=all_parkspace_data.parkspace_info_size())
+		//如果是小车 (低于1.55米属于小车)
+		if ( car_info.car_height() <= MIN_CAR_HIGH )
+		{
+			//获取所有小型车位信息
+			message::Parkspace_allocation_data_msg all_min_parkspace_data;
+			Error_manager t_error = m_parkspace_operating_function.get_specify_the_type_parkspace_info(all_min_parkspace_data, message::Parkspace_type::MIN_PARKINGSPACE);
+			if (t_error != SUCCESS)
+			{
+				return t_error;
+			}
+			//遍历所有小型车位
+			int i = 0;
+			while (i < all_min_parkspace_data.parkspace_info_size())
+			{
+				//筛选出一号车库的小型车位(第一优先级)的空车位
+				if (all_min_parkspace_data.parkspace_info(i).parkingspace_index_id() % 15 <= 8
+					&& all_min_parkspace_data.parkspace_info(i).parkingspace_index_id() % 15 >= 1
+					&& all_min_parkspace_data.parkspace_info(i).parkingspace_status() == message::Parkspace_status::eParkspace_empty)
+				{
+					//用时=目标终端到电梯口的距离/中跑车速度+(目标车位楼层-2)*楼层高度/电梯速度+电梯口到目标车位的距离/中跑车速度
+					float time = terminal_id % 6 * TERMINAL_SPACING / MEDIUM_CAR_SPEED + DOWNSTAIRS_SPORTS_TIME +
+								 (all_min_parkspace_data.parkspace_info(i).parkingspace_floor_id() - 2) *all_min_parkspace_data.parkspace_info(i).parkingspace_height() /THE_ELEVATOR_SPEED +ELEVATOR_MOVEMENT_TIME +
+								 all_min_parkspace_data.parkspace_info(i).parkingspace_index_id() % 15 *all_min_parkspace_data.parkspace_info(i).parkingspace_width() / MEDIUM_CAR_SPEED + UPSTAIRS_SPORTS_TIME;
+					if (time_min == 0)
+					{
+						time_min = time;
+						parkingspace_index_id = i;
+					}
+					else
+					{
+						time_min = time < time_min ? time : time_min;
+						parkingspace_index_id = i;
+					}
+				}
+				++i;
+			}
+			//判断小车车位(第一优先级)是否有找到合适的空车位   如果找到了  则不需要继续比较  直接返回
+			if ( time_min!=0 && parkingspace_index_id!=-1 )
+			{
+				parkspace_info.CopyFrom(all_min_parkspace_data.parkspace_info(parkingspace_index_id));
+				return Error_code::SUCCESS;
+			}
+		}
+		if ( car_info.car_height() <= MID_CAR_HIGH )
 		{
-			//筛选出空车位
-			if ( all_parkspace_data.parkspace_info(i).parkspace_status() == message::Parkspace_status::eParkspace_empty )
+			//第二优先级(中型车位)
+			//获取中型车位
+			message::Parkspace_allocation_data_msg all_mid_parkspace_data;
+			Error_manager t_error=m_parkspace_operating_function.get_specify_the_type_parkspace_info(all_mid_parkspace_data,message::Parkspace_type::MID_PARKINGSPACE);
+			if(t_error != SUCCESS)
 			{
-				//二楼所有车位统一处理
-				if ( all_parkspace_data.parkspace_info(i).floor() == 2  )
+				return t_error;
+			}
+			int i=0;
+			while(i<all_mid_parkspace_data.parkspace_info_size())
+			{
+				//三楼的中型车位有单独的中跑车停车  且机械臂可以直接抓车到三楼
+				if ( all_mid_parkspace_data.parkspace_info(i).parkingspace_index_id() >= 19
+					&& all_mid_parkspace_data.parkspace_info(i).parkingspace_index_id() <= 23)
 				{
-					int t_min=abs( i%15*all_parkspace_data.parkspace_info(i).width()-terminal_id%6*TERMINAL_SPACING )/MEDIUM_CAR_SPEED+DOWNSTAIRS_SPORTS_TIME;
+				    //只需计算端口到车位的距离
+					// 三楼中型用时=| 目标车位到电梯的距离 - 终端到电梯的距离 | / 中跑车速度
+					int t_min=abs( i%15*all_mid_parkspace_data.parkspace_info(i).parkingspace_width()-terminal_id%6*TERMINAL_SPACING )/MEDIUM_CAR_SPEED+DOWNSTAIRS_SPORTS_TIME;
 					if ( time_min == 0 )
 					{
 						time_min=t_min;
-						parkspace_id=i;
+						parkingspace_index_id=i;
 					}
 					else
 					{
 						time_min=t_min<time_min?t_min:time_min;
-						parkspace_id=i;
+						parkingspace_index_id=i;
 					}
 				}
-				else if( all_parkspace_data.parkspace_info(i).floor() == 3 )
+				//如果是六楼的中型车位
+				if ( all_mid_parkspace_data.parkspace_info(i).parkingspace_index_id() <= 68
+						&& all_mid_parkspace_data.parkspace_info(i).parkingspace_index_id() >=61
+						&& all_mid_parkspace_data.parkspace_info(i).parkingspace_status() == message::Parkspace_status::eParkspace_empty )
 				{
-					//三楼以上车位单独处理两侧位置车位
-				    if ( i%15==1 || i%15==2 || i%15==14 || i%15==0 )
+					//用时=目标终端到电梯口的距离/中跑车速度+(目标车位楼层-2)*楼层高度/电梯速度+电梯口到目标车位的距离/中跑车速度
+					float time=terminal_id%6*TERMINAL_SPACING/MEDIUM_CAR_SPEED  + DOWNSTAIRS_SPORTS_TIME +
+								(all_mid_parkspace_data.parkspace_info(i).parkingspace_floor_id()-2)*all_mid_parkspace_data.parkspace_info(i).parkingspace_height()/THE_ELEVATOR_SPEED + ELEVATOR_MOVEMENT_TIME +
+								all_mid_parkspace_data.parkspace_info(i).parkingspace_index_id()%15*all_mid_parkspace_data.parkspace_info(i).parkingspace_width()/MEDIUM_CAR_SPEED + UPSTAIRS_SPORTS_TIME;
+					if ( time_min == 0 )
 					{
-				    																//因机械手可以抓车到三楼所以三楼电梯高度减少一个楼层
-						int t_min=terminal_id%6*TERMINAL_SPACING/MEDIUM_CAR_SPEED + (all_parkspace_data.parkspace_info(i).floor()-1)*all_parkspace_data.parkspace_info(i).height()/THE_ELEVATOR_SPEED+DOWNSTAIRS_SPORTS_TIME+ELEVATOR_MOVEMENT_TIME;
+						time_min=time;
+						parkingspace_index_id=i;
+
+					}
+					else
+					{
+						time_min=time<time_min?time:time_min;
+						parkingspace_index_id=i;
+					}
+				}
+				++i;
+			}
+			//判断中型车位(第二优先级)是否有找到合适的空车位   如果找到了 直接返回
+			if ( time_min!=0 && parkingspace_index_id!=-1 )
+			{
+				parkspace_info.CopyFrom(all_mid_parkspace_data.parkspace_info(parkingspace_index_id));
+				return Error_code::SUCCESS;
+			}
+		}
+		if ( car_info.car_height() <= BIG_CAR_HIGH )
+		{
+			//第三优先级(大型车位)
+			//获取大型车位
+			message::Parkspace_allocation_data_msg all_big_parkspace_data;
+			Error_manager t_error=m_parkspace_operating_function.get_specify_the_type_parkspace_info(all_big_parkspace_data,message::Parkspace_type::BIG_PARKINGSPACE);
+			if(t_error != SUCCESS)
+			{
+				return t_error;
+			}
+			int i=0;
+			while(i<all_big_parkspace_data.parkspace_info_size())
+			{
+				//筛选出一号车库的小型车位的靠近电梯的左侧三排(第二优先级)的空车位
+				if ( all_big_parkspace_data.parkspace_info(i).parkingspace_index_id()%15 <= 8
+						&& all_big_parkspace_data.parkspace_info(i).parkingspace_index_id()%15 >=1
+							 && all_big_parkspace_data.parkspace_info(i).parkingspace_status() == message::Parkspace_status::eParkspace_empty )
+				{
+					//如果是二楼车 则特殊处理
+					if ( all_big_parkspace_data.parkspace_info(i).parkingspace_floor_id() == 2 )
+					{
+						// 二楼用时=| 目标车位到电梯的距离 - 终端到电梯的距离 | / 中跑车速度
+						int t_min=abs( i%15*all_big_parkspace_data.parkspace_info(i).parkingspace_width()-terminal_id%6*TERMINAL_SPACING )/MEDIUM_CAR_SPEED+DOWNSTAIRS_SPORTS_TIME;
 						if ( time_min == 0 )
 						{
 							time_min=t_min;
-							parkspace_id=i;
+							parkingspace_index_id=i;
 						}
 						else
 						{
 							time_min=t_min<time_min?t_min:time_min;
-							parkspace_id=i;
+							parkingspace_index_id=i;
 						}
-				    }
-				    else
-				    {
-						int t_min=abs( i%15*all_parkspace_data.parkspace_info(i).width()-terminal_id%6*TERMINAL_SPACING )/MEDIUM_CAR_SPEED+DOWNSTAIRS_SPORTS_TIME;
+					}
+					else
+					{
+						//用时=目标终端到电梯口的距离/中跑车速度+(目标车位楼层-2)*楼层高度/电梯速度+电梯口到目标车位的距离/中跑车速度
+						float time=terminal_id%6*TERMINAL_SPACING/MEDIUM_CAR_SPEED  + DOWNSTAIRS_SPORTS_TIME +
+								   (all_big_parkspace_data.parkspace_info(i).parkingspace_floor_id()-2)*all_big_parkspace_data.parkspace_info(i).parkingspace_height()/THE_ELEVATOR_SPEED + ELEVATOR_MOVEMENT_TIME +
+								   all_big_parkspace_data.parkspace_info(i).parkingspace_index_id()%15*all_big_parkspace_data.parkspace_info(i).parkingspace_width()/MEDIUM_CAR_SPEED + UPSTAIRS_SPORTS_TIME;
 						if ( time_min == 0 )
 						{
-							time_min=t_min;
-							parkspace_id=i;
+							time_min=time;
+							parkingspace_index_id=i;
+
 						}
 						else
 						{
-							time_min=t_min<time_min?t_min:time_min;
-							parkspace_id=i;
+							time_min=time<time_min?time:time_min;
+							parkingspace_index_id=i;
 						}
-				    }
+					}
 				}
-				else if(all_parkspace_data.parkspace_info(i).floor() == 4)
+				++i;
+			}
+			//判断大型车位(第三优先级)是否有找到合适的空车位   如果找到了  直接返回
+			if ( time_min!=0 && parkingspace_index_id!=-1 )
+			{
+				parkspace_info.CopyFrom(all_big_parkspace_data.parkspace_info(parkingspace_index_id));
+				return Error_code::SUCCESS;
+			}
+			else
+			{
+			    return Error_manager(Error_code::PARKSPACE_ALLOCATOR_ALLOCATE_FAILED, Error_level::MINOR_ERROR,
+			    					" query_the_optimal_parkspace_serverA error ");
+			}
+		}
+	}
+	//判断是否是右半库
+	else if(terminal_id<=6 && terminal_id>=4)
+	{
+		//如果是小车 (低于1.55米属于小车)
+		if ( car_info.car_height() <= MIN_CAR_HIGH )
+		{
+			//获取所有小型车位信息
+			message::Parkspace_allocation_data_msg all_min_parkspace_data;
+			Error_manager t_error = m_parkspace_operating_function.get_specify_the_type_parkspace_info(all_min_parkspace_data, message::Parkspace_type::MIN_PARKINGSPACE);
+			if (t_error != SUCCESS)
+			{
+				return t_error;
+			}
+			//遍历所有小型车位
+			int i = 0;
+			while (i < all_min_parkspace_data.parkspace_info_size())
+			{
+				//筛选出一号车库的小型车位(第一优先级)的空车位
+				if (all_min_parkspace_data.parkspace_info(i).parkingspace_index_id()  <= 165
+					&& all_min_parkspace_data.parkspace_info(i).parkingspace_index_id()  >= 54
+					&& all_min_parkspace_data.parkspace_info(i).parkingspace_status() == message::Parkspace_status::eParkspace_empty)
+				{
+					//用时=目标终端到电梯口的距离/中跑车速度+(目标车位楼层-2)*楼层高度/电梯速度+电梯口到目标车位的距离/中跑车速度
+					float time = terminal_id % 6 * TERMINAL_SPACING / MEDIUM_CAR_SPEED + DOWNSTAIRS_SPORTS_TIME +
+								 (all_min_parkspace_data.parkspace_info(i).parkingspace_floor_id() - 2) *all_min_parkspace_data.parkspace_info(i).parkingspace_height() /THE_ELEVATOR_SPEED +ELEVATOR_MOVEMENT_TIME +
+								 all_min_parkspace_data.parkspace_info(i).parkingspace_index_id() % 15 *all_min_parkspace_data.parkspace_info(i).parkingspace_width() / MEDIUM_CAR_SPEED + UPSTAIRS_SPORTS_TIME;
+					if (time_min == 0)
+					{
+						time_min = time;
+						parkingspace_index_id = i;
+					}
+					else
+					{
+						time_min = time < time_min ? time : time_min;
+						parkingspace_index_id = i;
+					}
+				}
+				++i;
+			}
+			//判断小车车位(第一优先级)是否有找到合适的空车位   如果找到了  则不需要继续比较  直接返回
+			if ( time_min!=0 && parkingspace_index_id!=-1 )
+			{
+				parkspace_info.CopyFrom(all_min_parkspace_data.parkspace_info(parkingspace_index_id));
+				return Error_code::SUCCESS;
+			}
+		}
+		if ( car_info.car_height() <= MID_CAR_HIGH )
+		{
+			//第二优先级(中型车位)
+			//获取中型车位
+			message::Parkspace_allocation_data_msg all_mid_parkspace_data;
+			Error_manager t_error=m_parkspace_operating_function.get_specify_the_type_parkspace_info(all_mid_parkspace_data,message::Parkspace_type::MID_PARKINGSPACE);
+			if(t_error != SUCCESS)
+			{
+				return t_error;
+			}
+			int i=0;
+			while(i<all_mid_parkspace_data.parkspace_info_size())
+			{
+				//三楼的中型车位有单独的中跑车停车  且机械臂可以直接抓车到三楼
+				if ( all_mid_parkspace_data.parkspace_info(i).parkingspace_index_id() >= 24
+					&& all_mid_parkspace_data.parkspace_info(i).parkingspace_index_id() <= 27 )
 				{
-					if ( i%15==1 || i%15==2 || i%15==14 || i%15==0 )
+					//只需计算端口到车位的距离
+					// 三楼中型车位用时=| 目标车位到电梯的距离 - 终端到电梯的距离 | / 中跑车速度
+					int t_min=abs( i%15*all_mid_parkspace_data.parkspace_info(i).parkingspace_width()-terminal_id%6*TERMINAL_SPACING )/MEDIUM_CAR_SPEED+DOWNSTAIRS_SPORTS_TIME;
+					if ( time_min == 0 )
 					{
-						int t_min=terminal_id%6*TERMINAL_SPACING/MEDIUM_CAR_SPEED + all_parkspace_data.parkspace_info(i).floor()*all_parkspace_data.parkspace_info(i).height()/THE_ELEVATOR_SPEED+DOWNSTAIRS_SPORTS_TIME+ELEVATOR_MOVEMENT_TIME;
+						time_min=t_min;
+						parkingspace_index_id=i;
+					}
+					else
+					{
+						time_min=t_min<time_min?t_min:time_min;
+						parkingspace_index_id=i;
+					}
+				}
+				if ( all_mid_parkspace_data.parkspace_info(i).parkingspace_index_id() <= 75
+					 && all_mid_parkspace_data.parkspace_info(i).parkingspace_index_id() >= 69
+					 && all_mid_parkspace_data.parkspace_info(i).parkingspace_status() == message::Parkspace_status::eParkspace_empty )
+				{
+					//用时=目标终端到电梯口的距离/中跑车速度+(目标车位楼层-2)*楼层高度/电梯速度+电梯口到目标车位的距离/中跑车速度
+					float time=terminal_id%6*TERMINAL_SPACING/MEDIUM_CAR_SPEED  + DOWNSTAIRS_SPORTS_TIME +
+							   (all_mid_parkspace_data.parkspace_info(i).parkingspace_floor_id()-2)*all_mid_parkspace_data.parkspace_info(i).parkingspace_height()/THE_ELEVATOR_SPEED + ELEVATOR_MOVEMENT_TIME +
+							   all_mid_parkspace_data.parkspace_info(i).parkingspace_index_id()%15*all_mid_parkspace_data.parkspace_info(i).parkingspace_width()/MEDIUM_CAR_SPEED + UPSTAIRS_SPORTS_TIME;
+					if ( time_min == 0 )
+					{
+						time_min=time;
+						parkingspace_index_id=i;
+
+					}
+					else
+					{
+						time_min=time<time_min?time:time_min;
+						parkingspace_index_id=i;
+					}
+				}
+				++i;
+			}
+			//判断中型车位(第二优先级)是否有找到合适的空车位   如果找到了 直接返回
+			if ( time_min!=0 && parkingspace_index_id!=-1 )
+			{
+				parkspace_info.CopyFrom(all_mid_parkspace_data.parkspace_info(parkingspace_index_id));
+				return Error_code::SUCCESS;
+			}
+		}
+		if ( car_info.car_height() <= BIG_CAR_HIGH )
+		{
+			//第三优先级(大型车位)
+			//获取大型车位
+			message::Parkspace_allocation_data_msg all_big_parkspace_data;
+			Error_manager t_error=m_parkspace_operating_function.get_specify_the_type_parkspace_info(all_big_parkspace_data,message::Parkspace_type::BIG_PARKINGSPACE);
+			if(t_error != SUCCESS)
+			{
+				return t_error;
+			}
+			int i=0;
+			while(i<all_big_parkspace_data.parkspace_info_size())
+			{
+				//筛选出二号车库的大型车位的空车位
+				if ( all_big_parkspace_data.parkspace_info(i).parkingspace_index_id() <= 45
+					 && all_big_parkspace_data.parkspace_info(i).parkingspace_index_id() >= 9
+					 && all_big_parkspace_data.parkspace_info(i).parkingspace_status() == message::Parkspace_status::eParkspace_empty )
+				{
+					//如果是二楼车 则特殊处理
+					if ( all_big_parkspace_data.parkspace_info(i).parkingspace_floor_id() == 2 )
+					{
+						// 二楼用时=| 目标车位到电梯的距离 - 终端到电梯的距离 | / 中跑车速度
+						int t_min=abs( i%15*all_big_parkspace_data.parkspace_info(i).parkingspace_width()-terminal_id%6*TERMINAL_SPACING )/MEDIUM_CAR_SPEED+DOWNSTAIRS_SPORTS_TIME;
 						if ( time_min == 0 )
 						{
 							time_min=t_min;
-							parkspace_id=i;
+							parkingspace_index_id=i;
 						}
 						else
 						{
 							time_min=t_min<time_min?t_min:time_min;
-							parkspace_id=i;
+							parkingspace_index_id=i;
 						}
 					}
 					else
 					{
-						//用时=电梯口到目标车位的距离/中跑车速度+目标终端到电梯口的距离/中跑车速度+目标车位楼层*楼层高度/电梯速度
-						int time_left= i%15*all_parkspace_data.parkspace_info(i).width()/MEDIUM_CAR_SPEED + UPSTAIRS_SPORTS_TIME + \
-								terminal_id%6*TERMINAL_SPACING/MEDIUM_CAR_SPEED + DOWNSTAIRS_SPORTS_TIME + \
-								all_parkspace_data.parkspace_info(i).floor()*all_parkspace_data.parkspace_info(i).height()/THE_ELEVATOR_SPEED + ELEVATOR_MOVEMENT_TIME;
-
-
-						int time_right=(15-i%15)*all_parkspace_data.parkspace_info(i).width()/MEDIUM_CAR_SPEED + UPSTAIRS_SPORTS_TIME + \
-								(6-terminal_id%6)*TERMINAL_SPACING/MEDIUM_CAR_SPEED + DOWNSTAIRS_SPORTS_TIME + \
-								all_parkspace_data.parkspace_info(i).floor()*all_parkspace_data.parkspace_info(i).height()/THE_ELEVATOR_SPEED + ELEVATOR_MOVEMENT_TIME;
-						time_min=time_left;
-						parkspace_id=i;
-						if ( time_left <= time_right )
+						//用时=目标终端到电梯口的距离/中跑车速度+(目标车位楼层-2)*楼层高度/电梯速度+电梯口到目标车位的距离/中跑车速度
+						float time=terminal_id%6*TERMINAL_SPACING/MEDIUM_CAR_SPEED  + DOWNSTAIRS_SPORTS_TIME +
+								   (all_big_parkspace_data.parkspace_info(i).parkingspace_floor_id()-2)*all_big_parkspace_data.parkspace_info(i).parkingspace_height()/THE_ELEVATOR_SPEED + ELEVATOR_MOVEMENT_TIME +
+								   all_big_parkspace_data.parkspace_info(i).parkingspace_index_id()%15*all_big_parkspace_data.parkspace_info(i).parkingspace_width()/MEDIUM_CAR_SPEED + UPSTAIRS_SPORTS_TIME;
+						if ( time_min == 0 )
 						{
-							if ( time_min>time_left )
-							{
-								time_min=time_left;
-								parkspace_id=i;
-							}
+							time_min=time;
+							parkingspace_index_id=i;
 						}
 						else
 						{
-							if ( time_min>time_right )
-							{
-								time_min=time_right;
-								parkspace_id=i;
-							}
+							time_min=time<time_min?time:time_min;
+							parkingspace_index_id=i;
 						}
 					}
+				}
+				++i;
+			}
+			//判断大型车位(第三优先级)是否有找到合适的空车位   如果找到了  直接返回
+			if ( time_min!=0 && parkingspace_index_id!=-1 )
+			{
+				parkspace_info.CopyFrom(all_big_parkspace_data.parkspace_info(parkingspace_index_id));
+				return Error_code::SUCCESS;
+			}
+			else
+			{
+				return Error_manager(Error_code::PARKSPACE_ALLOCATOR_ALLOCATE_FAILED, Error_level::MINOR_ERROR,
+									 " query_the_optimal_parkspace_serverA error ");
+			}
+		}
+	}
+	else
+	{
+	    return Error_manager(Error_code::PARAMETER_ERROR, Error_level::MINOR_ERROR,
+	    					"query_the_optimal_parkspace_serverA error ");
+	}
+}
+//找到一个最优车位---方案二
+//找左侧车位
+Error_manager Parkspace_manager::query_the_optimal_parkspace_serverB1(message::Parkspace_info &parkspace_info,message::Car_info car_info,int terminal_id)
+{
+	//车辆高大于1550mm分在四楼以下,小于1550mm分在四楼以上
+	/*
+	 * K=j%15
+	 * P=i%6
+	 * S=15*d-(j%15)*(2*d-1)+[6*d-(i%6)(2*d-1)]*W    W>1
+	 */
+	int time_min=0;
+	int parkingspace_index_id=-1;
+	//
+	//如果是小车 (低于1.55米属于小车)
+	if ( car_info.car_height() <= MIN_CAR_HIGH )
+	{
+		//获取所有小型车位信息
+		message::Parkspace_allocation_data_msg all_min_parkspace_data;
+		Error_manager t_error = m_parkspace_operating_function.get_specify_the_type_parkspace_info(all_min_parkspace_data, message::Parkspace_type::MIN_PARKINGSPACE);
+		if (t_error != SUCCESS)
+		{
+			return t_error;
+		}
+		//遍历所有小型车位
+		int i = 0;
+		while (i < all_min_parkspace_data.parkspace_info_size())
+		{
+			//筛选出一号车库的小型车位的中间部分(第一优先级)的空车位
+			if (all_min_parkspace_data.parkspace_info(i).parkingspace_index_id() % 15 <= 8
+				&& all_min_parkspace_data.parkspace_info(i).parkingspace_index_id() % 15 >= 4
+				&& all_min_parkspace_data.parkspace_info(i).parkingspace_status() == message::Parkspace_status::eParkspace_empty)
+			{
+				//用时=目标终端到电梯口的距离/中跑车速度+(目标车位楼层-2)*楼层高度/电梯速度+电梯口到目标车位的距离/中跑车速度
+				float time = terminal_id % 6 * TERMINAL_SPACING / MEDIUM_CAR_SPEED + DOWNSTAIRS_SPORTS_TIME +
+							 (all_min_parkspace_data.parkspace_info(i).parkingspace_floor_id() - 2) *all_min_parkspace_data.parkspace_info(i).parkingspace_height() /THE_ELEVATOR_SPEED +ELEVATOR_MOVEMENT_TIME +
+							 all_min_parkspace_data.parkspace_info(i).parkingspace_index_id() % 15 *all_min_parkspace_data.parkspace_info(i).parkingspace_width() / MEDIUM_CAR_SPEED + UPSTAIRS_SPORTS_TIME;
+				if (time_min == 0)
+				{
+					time_min = time;
+					parkingspace_index_id = i;
+				}
+				else
+				{
+					time_min = time < time_min ? time : time_min;
+					parkingspace_index_id = i;
+				}
+			}
+			++i;
+		}
+		//判断小车车位中间部分(第一优先级)是否有找到合适的空车位   如果找到了  则不需要继续比较  直接返回
+		if ( time_min!=0 && parkingspace_index_id!=-1 )
+		{
+			parkspace_info.CopyFrom(all_min_parkspace_data.parkspace_info(parkingspace_index_id));
+			return Error_code::SUCCESS;
+		}
+		else
+		{
+			//如果没找到则找小车车位第二优先级 (侧边)
+			int i = 0;
+			while (i < all_min_parkspace_data.parkspace_info_size())
+			{
+				//筛选出一号车库的小型车位的中间部分(第一优先级)的空车位
+				if (all_min_parkspace_data.parkspace_info(i).parkingspace_index_id() % 15 <= 3
+					&& all_min_parkspace_data.parkspace_info(i).parkingspace_index_id() % 15 >= 1
+					&& all_min_parkspace_data.parkspace_info(i).parkingspace_status() == message::Parkspace_status::eParkspace_empty)
+				{
+					//用时=目标终端到电梯口的距离/中跑车速度+(目标车位楼层-2)*楼层高度/电梯速度+电梯口到目标车位的距离/中跑车速度
+					float time = terminal_id % 6 * TERMINAL_SPACING / MEDIUM_CAR_SPEED + DOWNSTAIRS_SPORTS_TIME +
+								 (all_min_parkspace_data.parkspace_info(i).parkingspace_floor_id() - 2) *all_min_parkspace_data.parkspace_info(i).parkingspace_height() /THE_ELEVATOR_SPEED +ELEVATOR_MOVEMENT_TIME +
+								 all_min_parkspace_data.parkspace_info(i).parkingspace_index_id() % 15 *all_min_parkspace_data.parkspace_info(i).parkingspace_width() / MEDIUM_CAR_SPEED + UPSTAIRS_SPORTS_TIME;
+					if (time_min == 0)
+					{
+						time_min = time;
+						parkingspace_index_id = i;
+					}
+					else
+					{
+						time_min = time < time_min ? time : time_min;
+						parkingspace_index_id = i;
+					}
+				}
+				++i;
+			}
+			//判断小车车位侧边部分(第二优先级)是否有找到合适的空车位   如果找到了  则不需要继续比较  直接返回
+			if ( time_min!=0 && parkingspace_index_id!=-1 )
+			{
+				parkspace_info.CopyFrom(all_min_parkspace_data.parkspace_info(parkingspace_index_id));
+				return Error_code::SUCCESS;
+			}
+		}
+	}
+	if ( car_info.car_height() <= MID_CAR_HIGH )
+	{
+		//第二优先级(中型车位)
+		//获取中型车位
+		message::Parkspace_allocation_data_msg all_mid_parkspace_data;
+		Error_manager t_error=m_parkspace_operating_function.get_specify_the_type_parkspace_info(all_mid_parkspace_data,message::Parkspace_type::MID_PARKINGSPACE);
+		if(t_error != SUCCESS)
+		{
+			return t_error;
+		}
+		int i=0;
+		while(i<all_mid_parkspace_data.parkspace_info_size())
+		{
+			//如果是六楼的中型车位的中间部分(第一优先级)
+			if ( all_mid_parkspace_data.parkspace_info(i).parkingspace_index_id() <= 68
+				 && all_mid_parkspace_data.parkspace_info(i).parkingspace_index_id() >=64
+				 && all_mid_parkspace_data.parkspace_info(i).parkingspace_status() == message::Parkspace_status::eParkspace_empty )
+			{
+				//用时=目标终端到电梯口的距离/中跑车速度+(目标车位楼层-2)*楼层高度/电梯速度+电梯口到目标车位的距离/中跑车速度
+				float time=terminal_id%6*TERMINAL_SPACING/MEDIUM_CAR_SPEED  + DOWNSTAIRS_SPORTS_TIME +
+						   (all_mid_parkspace_data.parkspace_info(i).parkingspace_floor_id()-2)*all_mid_parkspace_data.parkspace_info(i).parkingspace_height()/THE_ELEVATOR_SPEED + ELEVATOR_MOVEMENT_TIME +
+						   all_mid_parkspace_data.parkspace_info(i).parkingspace_index_id()%15*all_mid_parkspace_data.parkspace_info(i).parkingspace_width()/MEDIUM_CAR_SPEED + UPSTAIRS_SPORTS_TIME;
+				if ( time_min == 0 )
+				{
+					time_min=time;
+					parkingspace_index_id=i;
 
 				}
+				else
+				{
+					time_min=time<time_min?time:time_min;
+					parkingspace_index_id=i;
+				}
 			}
 			++i;
 		}
+		//判断中型车位(第二优先级)是否有找到合适的空车位   如果找到了 直接返回
+		if ( time_min!=0 && parkingspace_index_id!=-1 )
+		{
+			parkspace_info.CopyFrom(all_mid_parkspace_data.parkspace_info(parkingspace_index_id));
+			return Error_code::SUCCESS;
+		}
 	}
-	else if ( car_info.car_height() <= CAR_HIGH_STANDARDS )
+	if ( car_info.car_height() <= BIG_CAR_HIGH )
 	{
-		//计算四楼以上最优车位
+		//第三优先级(大型车位)
+		//获取大型车位
+		message::Parkspace_allocation_data_msg all_big_parkspace_data;
+		Error_manager t_error=m_parkspace_operating_function.get_specify_the_type_parkspace_info(all_big_parkspace_data,message::Parkspace_type::BIG_PARKINGSPACE);
+		if(t_error != SUCCESS)
+		{
+			return t_error;
+		}
 		int i=0;
-		while (i<=all_parkspace_data.parkspace_info_size())
+		while(i<all_big_parkspace_data.parkspace_info_size())
 		{
-			if(all_parkspace_data.parkspace_info(i).floor()>4 \
-			&& all_parkspace_data.parkspace_info(i).parkspace_status() == message::Parkspace_status::eParkspace_empty)
+			//筛选出一号车库的小型车位的靠近电梯的左侧三排(第二优先级)的空车位
+			if ( all_big_parkspace_data.parkspace_info(i).parkingspace_index_id()%15 <= 8
+				 && all_big_parkspace_data.parkspace_info(i).parkingspace_index_id()%15 >=1
+				 && all_big_parkspace_data.parkspace_info(i).parkingspace_status() == message::Parkspace_status::eParkspace_empty )
 			{
-				if ( i%15==1 || i%15==2 || i%15==14 || i%15==0 )
+				//如果是二楼车 则特殊处理
+				if ( all_big_parkspace_data.parkspace_info(i).parkingspace_floor_id() == 2 )
 				{
-					int t_min=terminal_id%6*TERMINAL_SPACING/MEDIUM_CAR_SPEED + all_parkspace_data.parkspace_info(i).floor()*all_parkspace_data.parkspace_info(i).height()/THE_ELEVATOR_SPEED+DOWNSTAIRS_SPORTS_TIME+ELEVATOR_MOVEMENT_TIME;
+					// 二楼用时=| 目标车位到电梯的距离 - 终端到电梯的距离 | / 中跑车速度
+					int t_min=abs( i%15*all_big_parkspace_data.parkspace_info(i).parkingspace_width()-terminal_id%6*TERMINAL_SPACING )/MEDIUM_CAR_SPEED+DOWNSTAIRS_SPORTS_TIME;
 					if ( time_min == 0 )
 					{
 						time_min=t_min;
-						parkspace_id=i;
+						parkingspace_index_id=i;
 					}
 					else
 					{
 						time_min=t_min<time_min?t_min:time_min;
-						parkspace_id=i;
+						parkingspace_index_id=i;
 					}
 				}
 				else
 				{
-					//用时=电梯口到目标车位的距离/中跑车速度+目标终端到电梯口的距离/中跑车速度+目标车位楼层*楼层高度/电梯速度
-					int time_left= i%15*all_parkspace_data.parkspace_info(i).width()/MEDIUM_CAR_SPEED  + UPSTAIRS_SPORTS_TIME +  \
-								terminal_id%6*TERMINAL_SPACING/MEDIUM_CAR_SPEED  + DOWNSTAIRS_SPORTS_TIME + \
-								all_parkspace_data.parkspace_info(i).floor()*all_parkspace_data.parkspace_info(i).height()/THE_ELEVATOR_SPEED + ELEVATOR_MOVEMENT_TIME;
-
-
-					int time_right=(15-i%15)*all_parkspace_data.parkspace_info(i).width()/MEDIUM_CAR_SPEED + UPSTAIRS_SPORTS_TIME + \
-								(6-terminal_id%6)*TERMINAL_SPACING/MEDIUM_CAR_SPEED + DOWNSTAIRS_SPORTS_TIME + \
-								all_parkspace_data.parkspace_info(i).floor()*all_parkspace_data.parkspace_info(i).height()/THE_ELEVATOR_SPEED + ELEVATOR_MOVEMENT_TIME;
-					time_min=time_left;
-					parkspace_id=i;
-					if ( time_left <= time_right )
+					//用时=目标终端到电梯口的距离/中跑车速度+(目标车位楼层-2)*楼层高度/电梯速度+电梯口到目标车位的距离/中跑车速度
+					float time=terminal_id%6*TERMINAL_SPACING/MEDIUM_CAR_SPEED  + DOWNSTAIRS_SPORTS_TIME +
+							   (all_big_parkspace_data.parkspace_info(i).parkingspace_floor_id()-2)*all_big_parkspace_data.parkspace_info(i).parkingspace_height()/THE_ELEVATOR_SPEED + ELEVATOR_MOVEMENT_TIME +
+							   all_big_parkspace_data.parkspace_info(i).parkingspace_index_id()%15*all_big_parkspace_data.parkspace_info(i).parkingspace_width()/MEDIUM_CAR_SPEED + UPSTAIRS_SPORTS_TIME;
+					if ( time_min == 0 )
 					{
-						if ( time_min>time_left )
-						{
-							time_min=time_left;
-							parkspace_id=i;
-						}
+						time_min=time;
+						parkingspace_index_id=i;
+
 					}
 					else
 					{
-						if ( time_min>time_right )
-						{
-							time_min=time_right;
-							parkspace_id=i;
-						}
+						time_min=time<time_min?time:time_min;
+						parkingspace_index_id=i;
 					}
 				}
 			}
 			++i;
 		}
-
+		//判断大型车位(第三优先级)是否有找到合适的空车位   如果找到了  直接返回
+		if ( time_min!=0 && parkingspace_index_id!=-1 )
+		{
+			parkspace_info.CopyFrom(all_big_parkspace_data.parkspace_info(parkingspace_index_id));
+			return Error_code::SUCCESS;
+		}
+		else
+		{
+			return Error_manager(Error_code::PARKSPACE_ALLOCATOR_ALLOCATE_FAILED, Error_level::MINOR_ERROR,
+								 " query_the_optimal_parkspace_serverA error ");
+		}
 	}
 
-	parkspace_info.CopyFrom(all_parkspace_data.parkspace_info(parkspace_id));
-	return t_error;
+
+}
+//找右侧车位
+Error_manager Parkspace_manager::query_the_optimal_parkspace_serverB2(message::Parkspace_info &parkspace_info,message::Car_info car_info,int terminal_id)
+{
+	//车辆高大于1550mm分在四楼以下,小于1550mm分在四楼以上
+	/*
+	 * K=j%15
+	 * P=i%6
+	 * S=15*d-(j%15)*(2*d-1)+[6*d-(i%6)(2*d-1)]*W    W>1
+	 */
+	int time_min=0;
+	int parkingspace_index_id=-1;
+}
+//找缓存区车位
+Error_manager Parkspace_manager::query_the_optimal_parkspace_serverB3(message::Parkspace_info &parkspace_info,message::Car_info car_info,int terminal_id)
+{
+	//车辆高大于1550mm分在四楼以下,小于1550mm分在四楼以上
+	/*
+	 * K=j%15
+	 * P=i%6
+	 * S=15*d-(j%15)*(2*d-1)+[6*d-(i%6)(2*d-1)]*W    W>1
+	 */
+	int time_min=0;
+	int parkingspace_index_id=-1;
 }
 //分配车位线程函数
 void Parkspace_manager::execute_for_allocate(message::Car_info car_info, int terminal_id, std::string command_key)
@@ -444,8 +848,10 @@ void Parkspace_manager::execute_for_allocate(message::Car_info car_info, int ter
 	}
 	else
 	{
+		m_parkspace_lock.lock();
 		//如果车辆不存在 则找到一个最优车位
 //		error=query_the_optimal_parkspace(t_allocated_space,car_info,terminal_id);
+//		query_the_optimal_parkspace_serverA(t_allocated_space,car_info,terminal_id);
 		//如果车辆不存在则获取一个空车位
 		error=m_parkspace_operating_function.query_one_empty_parkspace(t_allocated_space);
 		if ( error != Error_code::SUCCESS )
@@ -458,7 +864,7 @@ void Parkspace_manager::execute_for_allocate(message::Car_info car_info, int ter
 		else
 		{
 			//修改车为状态为锁定
-			t_allocated_space.set_parkspace_status(message::Parkspace_status::eParkspace_locked);
+			t_allocated_space.set_parkingspace_status(message::Parkspace_status::eParkspace_locked);
 			t_allocated_space.mutable_car_info()->CopyFrom(car_info);
 			// 分配车位后更新车位状态
 			error=m_parkspace_operating_function.update_parkspace_data(t_allocated_space);
@@ -485,10 +891,11 @@ void Parkspace_manager::execute_for_allocate(message::Car_info car_info, int ter
 				{
 					t_error.set_error_code(SUCCESS);
 					t_error.set_error_level(message::Error_level::NORMAL);
-					LOG(INFO) <<"分配车位成功     "<<"车位ID:"<<t_allocated_space.parkspace_id()<<"     车牌号:"<<t_allocated_space.car_info().license();
+					LOG(INFO) <<"分配车位成功     "<<"车位ID:"<<t_allocated_space.parkingspace_index_id()<<"     车牌号:"<<t_allocated_space.car_info().license();
 				}
 			}
 		}
+		m_parkspace_lock.unlock();
 	}
 	response_msg.mutable_base_info()->CopyFrom(t_response_header);
 	response_msg.set_command_key(command_key);
@@ -529,7 +936,7 @@ void Parkspace_manager::execute_for_search(message::Car_info car_info,std::strin
 	{
 		t_error.set_error_code(SUCCESS);
 		t_error.set_error_level(message::Error_level::NORMAL);
-		LOG(INFO) << "车辆"<<parkspace_info.car_info().license()<<"     在"<<parkspace_info.parkspace_id()<<"号车位上";
+		LOG(INFO) << "车辆"<<parkspace_info.car_info().license()<<"     在"<<parkspace_info.parkingspace_index_id()<<"号车位上";
 	}
 	response_msg.mutable_base_info()->CopyFrom(t_response_header);
 	response_msg.set_command_key(command_key);
@@ -556,7 +963,8 @@ void Parkspace_manager::execute_for_release(message::Parkspace_info space_info,
 	message::Error_manager t_error;
 	message::Parkspace_info t_release_space;
 	//找到待释放的车位
-	Error_manager error=m_parkspace_operating_function.query_one_parkspace_with_parkspace_id(space_info.parkspace_id(),t_release_space);
+	m_parkspace_lock.lock();
+	Error_manager error=m_parkspace_operating_function.query_one_parkspace_with_parkspace_id(space_info.parkingspace_index_id(),t_release_space);
 	if ( error != SUCCESS )
 	{
 		t_error.set_error_code(error.get_error_code());
@@ -572,7 +980,7 @@ void Parkspace_manager::execute_for_release(message::Parkspace_info space_info,
 	}
 	else
 	{
-		t_release_space.set_parkspace_status(message::Parkspace_status::eParkspace_empty);
+		t_release_space.set_parkingspace_status(message::Parkspace_status::eParkspace_empty);
 		error = m_parkspace_operating_function.update_parkspace_data(t_release_space);
 		if (error != SUCCESS)
 		{
@@ -597,7 +1005,7 @@ void Parkspace_manager::execute_for_release(message::Parkspace_info space_info,
 
 				t_error.set_error_code(SUCCESS);
 				t_error.set_error_level(message::Error_level::NORMAL);
-				LOG(INFO) << "第:" << t_release_space.parkspace_id() << "号位     车辆: " << t_release_space.car_info().license()
+				LOG(INFO) << "第:" << t_release_space.parkingspace_index_id() << "号位     车辆: " << t_release_space.car_info().license()
 						  << "     释放成功";
 
 				//获取预约ID
@@ -637,6 +1045,7 @@ void Parkspace_manager::execute_for_release(message::Parkspace_info space_info,
 			}
 		}
 	}
+	m_parkspace_lock.unlock();
 	response_msg.mutable_base_info()->CopyFrom(t_response_header);
 	response_msg.set_command_key(command_key);
 	response_msg.mutable_error_manager()->CopyFrom(t_error);
@@ -666,7 +1075,7 @@ void Parkspace_manager::execute_for_force_update(message::Parkspace_info space_i
 	message::Parkspace_info t_update_space;
 	Error_manager error;
 	// id 9999为特殊情况,复位所有车位状态
-	if (space_info.parkspace_id() == 9999)
+	if (space_info.parkingspace_index_id() == 9999)
 	{
 		// 复位所有车位状态
 		error=m_parkspace_operating_function.clear_all_parkspace_info();
@@ -697,7 +1106,7 @@ void Parkspace_manager::execute_for_force_update(message::Parkspace_info space_i
 		{
 			t_error.set_error_code(SUCCESS);
 			t_error.set_error_level(message::Error_level::NORMAL);
-			LOG(INFO) << "第" << t_update_space.parkspace_id() << "号位已手动更新";
+			LOG(INFO) << "第" << t_update_space.parkingspace_index_id() << "号位已手动更新";
 		}
 	}
 
@@ -728,7 +1137,8 @@ void Parkspace_manager::execute_for_confirm_alloc(message::Parkspace_info space_
 	message::Parkspace_info t_confirm_space;
 	Error_manager error;
 	//获取确认分配的车位
-	error = m_parkspace_operating_function.query_one_parkspace_with_parkspace_id(space_info.parkspace_id(),
+	m_parkspace_lock.lock();
+	error = m_parkspace_operating_function.query_one_parkspace_with_parkspace_id(space_info.parkingspace_index_id(),
 																				 t_confirm_space);
 	if (error != SUCCESS)
 	{
@@ -746,7 +1156,7 @@ void Parkspace_manager::execute_for_confirm_alloc(message::Parkspace_info space_
 	else
 	{
 		//校验车位状态是否为被锁定
-		if (t_confirm_space.parkspace_status() != message::Parkspace_status::eParkspace_locked)
+		if (t_confirm_space.parkingspace_status() != message::Parkspace_status::eParkspace_locked)
 		{
 			t_error.set_error_code(DB_QUERY_DATA_FAILED);
 			t_error.set_error_level(message::Error_level::MINOR_ERROR);
@@ -756,7 +1166,7 @@ void Parkspace_manager::execute_for_confirm_alloc(message::Parkspace_info space_
 		else
 		{
 			//修改车位状态为占用
-			t_confirm_space.set_parkspace_status(message::Parkspace_status::eParkspace_occupied);
+			t_confirm_space.set_parkingspace_status(message::Parkspace_status::eParkspace_occupied);
 			error = m_parkspace_operating_function.update_parkspace_data(t_confirm_space);
 			if (error != SUCCESS)
 			{
@@ -778,7 +1188,7 @@ void Parkspace_manager::execute_for_confirm_alloc(message::Parkspace_info space_
 				}
 				t_error.set_error_code(SUCCESS);
 				t_error.set_error_level(message::Error_level::NORMAL);
-				LOG(INFO) << "第:" << t_confirm_space.parkspace_id() << "号位     车辆: " << t_confirm_space.car_info().license()<< "     确认占用成功";
+				LOG(INFO) << "第:" << t_confirm_space.parkingspace_index_id() << "号位     车辆: " << t_confirm_space.car_info().license()<< "     确认占用成功";
 				//插入停车记录
 				time_t tt = time(NULL);
 				tm *t = localtime(&tt);
@@ -819,6 +1229,7 @@ void Parkspace_manager::execute_for_confirm_alloc(message::Parkspace_info space_
 			}
 		}
 	}
+	m_parkspace_lock.unlock();
 	response_msg.mutable_base_info()->CopyFrom(t_response_header);
 	response_msg.set_command_key(command_key);
 	response_msg.mutable_error_manager()->CopyFrom(t_error);

+ 15 - 4
parkspace_allocation/parkspace_manager.h

@@ -31,8 +31,12 @@ public:
         eParkspace_manager_normal,
         eParkspace_manager_fault
     };
-    //车高判断标准 默认1550mm
-#define CAR_HIGH_STANDARDS		1550
+	//小型车高判断标准 默认1550mm
+#define MIN_CAR_HIGH			1.55
+//中型车高判断标准 (暂时未定)   手写1.75
+#define MID_CAR_HIGH			1.75
+//大型车高判断标准 (暂时未定)   手写1.65
+#define BIG_CAR_HIGH			1.95
 //中跑车速度 米每秒
 #define MEDIUM_CAR_SPEED		0.8
 //电梯速度  米每秒
@@ -76,8 +80,15 @@ public://API functions
 public://execute_msg创建各线程进行处理
 	//发送车位数据函数  在接收到请求和进行数据库操作后调用
 	Error_manager send_parkspace_data();
-	//找到一个最优车位
-	Error_manager query_the_optimal_parkspace(message::Parkspace_info &parkspace_info,message::Car_info car_info,int terminal_id);
+	//找到一个最优车位---方案1
+	Error_manager query_the_optimal_parkspace_serverA(message::Parkspace_info &parkspace_info,message::Car_info car_info,int terminal_id);
+	//找到一个最优车位---方案2(带缓冲区)
+	//找左侧车位
+	Error_manager query_the_optimal_parkspace_serverB1(message::Parkspace_info &parkspace_info,message::Car_info car_info,int terminal_id);
+	//找右侧车位
+	Error_manager query_the_optimal_parkspace_serverB2(message::Parkspace_info &parkspace_info,message::Car_info car_info,int terminal_id);
+	//找缓冲区车位
+	Error_manager query_the_optimal_parkspace_serverB3(message::Parkspace_info &parkspace_info,message::Car_info car_info,int terminal_id);
 	//分配车位线程函数
     void execute_for_allocate(message::Car_info car_info, int terminal_id,std::string command_key);
     //查询车位线程函数

+ 153 - 69
parkspace_allocation/parkspace_operating_function.cpp

@@ -31,41 +31,41 @@ Error_manager Parkspace_operating_function::get_all_parkspace_info(message::Park
 			memset(buf, 0, 1024);
 			try
 			{
-				t_parkspace->set_parkspace_id(tp_result->getInt("parkingSpaceID"));
-				t_parkspace->set_block_id(tp_result->getInt("parkingSpaceBlockID"));
-				t_parkspace->set_index(tp_result->getInt("parkingSpaceIndex"));
-				if (tp_result->getInt("parkingSpaceDirection") > 0)
+				t_parkspace->set_parkingspace_index_id(tp_result->getInt("parkingSpaceID"));
+				t_parkspace->set_parkingspace_unit_id(tp_result->getInt("parkingspace_unit_id"));
+				t_parkspace->set_parkingspace_room_id(tp_result->getInt("parkingspace_room_id"));
+				if (tp_result->getInt("parkingspace_direction") > 0)
 				{
-					t_parkspace->set_direction(message::Direction::eForward);
+					t_parkspace->set_parkingspace_direction(message::Direction::eForward);
 				}
 				else
 				{
-					t_parkspace->set_direction(message::Direction::eBackward);
+					t_parkspace->set_parkingspace_direction(message::Direction::eBackward);
 				}
-				t_parkspace->set_floor(tp_result->getInt("parkingSpaceFloor"));
-				switch (tp_result->getInt("parkingSpaceState"))
+				t_parkspace->set_parkingspace_floor_id(tp_result->getInt("parkingspace_floor_id"));
+				switch (tp_result->getInt("parkingspace_status"))
 				{
 					case 0:
-						t_parkspace->set_parkspace_status(message::Parkspace_status::eParkspace_empty);
+						t_parkspace->set_parkingspace_status(message::Parkspace_status::eParkspace_empty);
 						break;
 					case 1:
-						t_parkspace->set_parkspace_status(message::Parkspace_status::eParkspace_occupied);
+						t_parkspace->set_parkingspace_status(message::Parkspace_status::eParkspace_occupied);
 						break;
 					case 2:
-						t_parkspace->set_parkspace_status(message::Parkspace_status::eParkspace_reserved);
+						t_parkspace->set_parkingspace_status(message::Parkspace_status::eParkspace_reserved);
 						break;
 					case 3:
-						t_parkspace->set_parkspace_status(message::Parkspace_status::eParkspace_locked);
+						t_parkspace->set_parkingspace_status(message::Parkspace_status::eParkspace_locked);
 						break;
 					case 4:
-						t_parkspace->set_parkspace_status(message::Parkspace_status::eParkspace_error);
+						t_parkspace->set_parkingspace_status(message::Parkspace_status::eParkspace_error);
 						break;
 					default:
-						t_parkspace->set_parkspace_status(message::Parkspace_status::eParkspace_error);
+						t_parkspace->set_parkingspace_status(message::Parkspace_status::eParkspace_error);
 						break;
 				}
-				t_parkspace->set_width(tp_result->getDouble("parkSpaceWidth"));
-				t_parkspace->set_height(tp_result->getDouble("parkSpaceHeight"));
+				t_parkspace->set_parkingspace_width(tp_result->getDouble("parkingspace_width"));
+				t_parkspace->set_parkingspace_height(tp_result->getDouble("parkingspace_height"));
 				t_parkspace->mutable_car_info()->set_license(tp_result->getString("parkSpaceCarLicense"));
 				t_parkspace->mutable_car_info()->set_car_length(tp_result->getDouble("parkSpaceCarLength"));
 				t_parkspace->mutable_car_info()->set_car_width(tp_result->getDouble("parkSpaceCarWidth"));
@@ -93,7 +93,91 @@ Error_manager Parkspace_operating_function::get_all_parkspace_info(message::Park
 	    return ec;
 	}
 }
-
+// 从数据库获得所有小型车位信息,用于车位模块初始化
+Error_manager Parkspace_operating_function::get_specify_the_type_parkspace_info(message::Parkspace_allocation_data_msg &all_specify_the_type_parkspace_info,int parkspace_type)
+{
+	//执行sql操作
+	char all_specify_the_type_sql[1024];
+	memset(all_specify_the_type_sql, 0, 1024);
+	sprintf(all_specify_the_type_sql,"select * from parkingspace where parkingspace_type= %d",3);
+	boost::shared_ptr<sql::ResultSet>  tp_result = nullptr;
+	Error_manager ec = Database_controller::get_instance_pointer()->sql_query(all_specify_the_type_sql, tp_result);
+	if(ec == SUCCESS)
+	{
+		if (tp_result == nullptr)
+		{
+			return DB_RESULT_SET_EMPTY;
+		}
+		all_specify_the_type_parkspace_info.clear_parkspace_info();
+		while (tp_result->next())
+		{
+			message::Parkspace_info *t_parkspace = all_specify_the_type_parkspace_info.add_parkspace_info();
+			char buf[1024];
+			memset(buf, 0, 1024);
+			try
+			{
+				t_parkspace->set_parkingspace_index_id(tp_result->getInt("parkingSpaceID"));
+				t_parkspace->set_parkingspace_unit_id(tp_result->getInt("parkingspace_unit_id"));
+				t_parkspace->set_parkingspace_room_id(tp_result->getInt("parkingspace_room_id"));
+				if (tp_result->getInt("parkingspace_direction") > 0)
+				{
+					t_parkspace->set_parkingspace_direction(message::Direction::eForward);
+				}
+				else
+				{
+					t_parkspace->set_parkingspace_direction(message::Direction::eBackward);
+				}
+				t_parkspace->set_parkingspace_floor_id(tp_result->getInt("parkingspace_floor_id"));
+				switch (tp_result->getInt("parkingspace_status"))
+				{
+					case 0:
+						t_parkspace->set_parkingspace_status(message::Parkspace_status::eParkspace_empty);
+						break;
+					case 1:
+						t_parkspace->set_parkingspace_status(message::Parkspace_status::eParkspace_occupied);
+						break;
+					case 2:
+						t_parkspace->set_parkingspace_status(message::Parkspace_status::eParkspace_reserved);
+						break;
+					case 3:
+						t_parkspace->set_parkingspace_status(message::Parkspace_status::eParkspace_locked);
+						break;
+					case 4:
+						t_parkspace->set_parkingspace_status(message::Parkspace_status::eParkspace_error);
+						break;
+					default:
+						t_parkspace->set_parkingspace_status(message::Parkspace_status::eParkspace_error);
+						break;
+				}
+				t_parkspace->set_parkingspace_width(tp_result->getDouble("parkingspace_width"));
+				t_parkspace->set_parkingspace_height(tp_result->getDouble("parkingspace_height"));
+				t_parkspace->mutable_car_info()->set_license(tp_result->getString("parkSpaceCarLicense"));
+				t_parkspace->mutable_car_info()->set_car_length(tp_result->getDouble("parkSpaceCarLength"));
+				t_parkspace->mutable_car_info()->set_car_width(tp_result->getDouble("parkSpaceCarWidth"));
+				t_parkspace->mutable_car_info()->set_car_height(tp_result->getDouble("parkSpaceCarHeight"));
+				t_parkspace->set_entry_time(tp_result->getString("entryTime"));
+				t_parkspace->set_leave_time(tp_result->getString("leaveTime"));
+			}
+			catch (sql::SQLException &e)
+			{
+				/* Use what() (derived from std::runtime_error) to fetch the error message */
+				sprintf(buf, "# ERR: %s\n (MySQL error code: %d, SQLState: %s", e.what(), e.getErrorCode(),
+						e.getSQLState().c_str());
+				return Error_manager(DB_RESULT_SET_PARSE_ERROR, NEGLIGIBLE_ERROR, buf);
+			}
+			catch (std::runtime_error &e)
+			{
+				sprintf(buf, "# ERR: %s\n ERR: runtime_error in  %s ", e.what(), __FILE__);
+				return Error_manager(DB_RESULT_SET_PARSE_ERROR, NEGLIGIBLE_ERROR, buf);
+			}
+		}
+		return SUCCESS;
+	}
+	else
+	{
+		return ec;
+	}
+}
 // 清除数据库中所有车位号牌,状态全修改为空闲
 Error_manager Parkspace_operating_function::clear_all_parkspace_info()
 {
@@ -101,7 +185,7 @@ Error_manager Parkspace_operating_function::clear_all_parkspace_info()
 	//执行sql操作
 	char update_space_sql[1024];
 	memset(update_space_sql, 0, 1024);
-	sprintf(update_space_sql, "update parkingspace set parkingSpaceState = 0,parkSpaceCarLicense = NULL,parkSpaceCarLength = 0,parkSpaceCarWidth = 0,parkSpaceCarHeight = 0,entryTime = NULL,leaveTime = NULL");
+	sprintf(update_space_sql, "update parkingspace set parkingspace_status = 0,parkSpaceCarLicense = NULL,parkSpaceCarLength = 0,parkSpaceCarWidth = 0,parkSpaceCarHeight = 0,entryTime = NULL,leaveTime = NULL");
 	Error_manager ec = Database_controller::get_instance_pointer()->sql_update(update_space_sql);
 	return ec;
 }
@@ -113,7 +197,7 @@ Error_manager Parkspace_operating_function::update_parkspace_data(message::Parks
 	char update_space_sql[1024];
 	memset(update_space_sql, 0, 1024);
 	int status = -1;
-	switch (parkspace_info.parkspace_status())
+	switch (parkspace_info.parkingspace_status())
 	{
 	case message::Parkspace_status::eParkspace_empty:
 		status = 0;
@@ -137,7 +221,7 @@ Error_manager Parkspace_operating_function::update_parkspace_data(message::Parks
 	}
 	if(parkspace_info.has_car_info() && status!=message::Parkspace_status::eParkspace_empty)
 	{
-		sprintf(update_space_sql, "update parkingspace set parkingSpaceState = %d,parkSpaceCarLicense = '%s',parkSpaceCarLength = %.3f,parkSpaceCarWidth = %.3f,parkSpaceCarHeight = %.3f,entryTime = '%s',leaveTime = '%s' where parkingSpaceID = %d",
+		sprintf(update_space_sql, "update parkingspace set parkingspace_status = %d,parkSpaceCarLicense = '%s',parkSpaceCarLength = %.3f,parkSpaceCarWidth = %.3f,parkSpaceCarHeight = %.3f,entryTime = '%s',leaveTime = '%s' where parkingSpaceID = %d",
 				status,
 				parkspace_info.car_info().license().c_str(),
 				parkspace_info.car_info().has_car_length()?parkspace_info.car_info().car_length():0.0f,
@@ -145,10 +229,10 @@ Error_manager Parkspace_operating_function::update_parkspace_data(message::Parks
 				parkspace_info.car_info().car_height(),
 				parkspace_info.entry_time().c_str(),
 				parkspace_info.leave_time().c_str(),
-				parkspace_info.parkspace_id());
+				parkspace_info.parkingspace_index_id());
 	}else
 	{
-		sprintf(update_space_sql, "update parkingspace set parkingSpaceState = %d,parkSpaceCarLicense = NULL,parkSpaceCarLength = 0,parkSpaceCarWidth = 0,parkSpaceCarHeight = 0,entryTime = NULL,leaveTime = NULL where parkingSpaceID = %d", status, parkspace_info.parkspace_id());
+		sprintf(update_space_sql, "update parkingspace set parkingspace_status = %d,parkSpaceCarLicense = NULL,parkSpaceCarLength = 0,parkSpaceCarWidth = 0,parkSpaceCarHeight = 0,entryTime = NULL,leaveTime = NULL where parkingSpaceID = %d", status, parkspace_info.parkingspace_index_id());
 	}
 	//boost::shared_ptr<sql::ResultSet>  tp_result = nullptr;
 	Error_manager ec = Database_controller::get_instance_pointer()->sql_update(update_space_sql);
@@ -200,7 +284,7 @@ Error_manager Parkspace_operating_function::update_vehicle_with_parkspace(messag
 			break;
 		}
 		//车位为空,仅更新车辆状态与长宽高
-		if(parkspace_info.parkspace_id() <= 0)
+		if(parkspace_info.parkingspace_index_id() <= 0)
 		{
 			sprintf(update_vehicle_sql, "update vehicle set vehicleParkState = %d,carLength=%.3f,carWidth=%.3f,carHeight=%.3f where numberPlate = '%s'",
 					vehicle_status_code,
@@ -217,7 +301,7 @@ Error_manager Parkspace_operating_function::update_vehicle_with_parkspace(messag
 					parkspace_info.car_info().car_length(),
 					parkspace_info.car_info().car_width(),
 					parkspace_info.car_info().car_height(),
-					parkspace_info.parkspace_id(),
+					parkspace_info.parkingspace_index_id(),
 					parkspace_info.car_info().license().c_str());
 		}
 		Error_manager ec = Database_controller::get_instance_pointer()->sql_update(update_vehicle_sql);
@@ -278,7 +362,7 @@ Error_manager Parkspace_operating_function::insert_vehicle_with_parkspace(messag
 			break;
 	}
 	//车位为空,仅更新车辆状态与长宽高
-	if(parkspace_info.parkspace_id() <= 0)
+	if(parkspace_info.parkingspace_index_id() <= 0)
 	{
 		sprintf(insert_vehicle_sql, "INSERT INTO vehicle (numberPlate,vehicleParkState,carLength,carWidth,carHeight) values ('%s',%d,%.3f,%.3f,%.3f)",
 				parkspace_info.car_info().license().c_str(),
@@ -296,7 +380,7 @@ Error_manager Parkspace_operating_function::insert_vehicle_with_parkspace(messag
 			parkspace_info.car_info().car_length(),
 			parkspace_info.car_info().car_width(),
 			parkspace_info.car_info().car_height(),
-			parkspace_info.parkspace_id());
+			parkspace_info.parkingspace_index_id());
 	}
 	Error_manager ec = Database_controller::get_instance_pointer()->sql_insert(insert_vehicle_sql);
 	return ec;
@@ -307,7 +391,7 @@ Error_manager Parkspace_operating_function::insert_vehicle_with_parkspace(messag
 Error_manager Parkspace_operating_function::insert_parking_record(message::Parkspace_info parkspace_info)
 {
 	//参数中必须包含车辆信息与车位编号
-	if(!parkspace_info.has_car_info() || parkspace_info.parkspace_id() <= 0)
+	if(!parkspace_info.has_car_info() || parkspace_info.parkingspace_index_id() <= 0)
 	{
 		return Error_manager(Error_code::PARAMETER_ERROR, Error_level::MINOR_ERROR,
 							 "参数错误 Parkspace_operating_function::insert_parking_record error ");
@@ -317,7 +401,7 @@ Error_manager Parkspace_operating_function::insert_parking_record(message::Parks
 	//将车辆号牌,车位ID,记录状态,停车与取车时间写入
 		sprintf(insert_parking_record_sql, "INSERT INTO parkingrecords (numberPlate,parkingSpaceID,realParkTime) values ('%s',%d,'%s')",
 				parkspace_info.car_info().license().c_str(),
-				parkspace_info.parkspace_id(),
+				parkspace_info.parkingspace_index_id(),
 				parkspace_info.entry_time().c_str());
 	Error_manager ec = Database_controller::get_instance_pointer()->sql_insert(insert_parking_record_sql);
 	return ec;
@@ -328,7 +412,7 @@ Error_manager Parkspace_operating_function::insert_parking_record(message::Parks
 Error_manager Parkspace_operating_function::update_parking_record(message::Parkspace_info parkspace_info, int record_id)
 {
 	//执行sql操作
-	if(!parkspace_info.has_car_info() || parkspace_info.parkspace_id() <= 0)
+	if(!parkspace_info.has_car_info() || parkspace_info.parkingspace_index_id() <= 0)
 	{
 		return Error_manager(Error_code::PARAMETER_ERROR, Error_level::MINOR_ERROR,
 										   "参数错误 update_parking_record::insert_parking_record error ");;
@@ -364,34 +448,34 @@ Error_manager Parkspace_operating_function::query_one_parkspace_with_parkspace_i
 			memset(buf, 0, 1024);
 			try
 			{
-				switch (tp_result->getInt("parkingSpaceState"))
+				switch (tp_result->getInt("parkingspace_status"))
 				{
 				case 0:
-					parkspace_info.set_parkspace_status(message::Parkspace_status::eParkspace_empty);
+					parkspace_info.set_parkingspace_status(message::Parkspace_status::eParkspace_empty);
 					break;
 				case 1:
-					parkspace_info.set_parkspace_status(message::Parkspace_status::eParkspace_occupied);
+					parkspace_info.set_parkingspace_status(message::Parkspace_status::eParkspace_occupied);
 					break;
 				case 2:
-					parkspace_info.set_parkspace_status(message::Parkspace_status::eParkspace_reserved);
+					parkspace_info.set_parkingspace_status(message::Parkspace_status::eParkspace_reserved);
 					break;
 				case 3:
-					parkspace_info.set_parkspace_status(message::Parkspace_status::eParkspace_locked);
+					parkspace_info.set_parkingspace_status(message::Parkspace_status::eParkspace_locked);
 					break;
 				case 4:
-					parkspace_info.set_parkspace_status(message::Parkspace_status::eParkspace_error);
+					parkspace_info.set_parkingspace_status(message::Parkspace_status::eParkspace_error);
 					break;
 				default:
-					parkspace_info.set_parkspace_status(message::Parkspace_status::eParkspace_error);
+					parkspace_info.set_parkingspace_status(message::Parkspace_status::eParkspace_error);
 					break;
 				}
-				parkspace_info.set_parkspace_id(tp_result->getInt("parkingSpaceID"));
-				parkspace_info.set_block_id(tp_result->getInt("parkingSpaceBlockID"));
-				parkspace_info.set_index(tp_result->getInt("parkingSpaceIndex"));
-				parkspace_info.set_direction(tp_result->getInt("parkingSpaceDirection") > 0 ? message::Direction::eForward : message::Direction::eBackward);
-				parkspace_info.set_floor(tp_result->getInt("parkingSpaceFloor"));
-				parkspace_info.set_width(tp_result->getDouble("parkSpaceWidth"));
-				parkspace_info.set_height(tp_result->getDouble("parkSpaceHeight"));
+				parkspace_info.set_parkingspace_index_id(tp_result->getInt("parkingSpaceID"));
+				parkspace_info.set_parkingspace_unit_id(tp_result->getInt("parkingspace_unit_id"));
+				parkspace_info.set_parkingspace_room_id(tp_result->getInt("parkingspace_room_id"));
+				parkspace_info.set_parkingspace_direction(tp_result->getInt("parkingspace_direction") > 0 ? message::Direction::eForward : message::Direction::eBackward);
+				parkspace_info.set_parkingspace_floor_id(tp_result->getInt("parkingspace_floor_id"));
+				parkspace_info.set_parkingspace_width(tp_result->getDouble("parkingspace_width"));
+				parkspace_info.set_parkingspace_height(tp_result->getDouble("parkingspace_height"));
 
 				parkspace_info.mutable_car_info()->set_license(tp_result->getString("parkSpaceCarLicense"));
 				parkspace_info.mutable_car_info()->set_car_length(tp_result->getDouble("parkSpaceCarLength"));
@@ -452,34 +536,34 @@ Error_manager Parkspace_operating_function::query_one_parkspace_with_license(std
 			memset(buf, 0, 1024);
 			try
 			{
-				switch (tp_result->getInt("parkingSpaceState"))
+				switch (tp_result->getInt("parkingspace_status"))
 				{
 					case 0:
-						parkspace_info.set_parkspace_status(message::Parkspace_status::eParkspace_empty);
+						parkspace_info.set_parkingspace_status(message::Parkspace_status::eParkspace_empty);
 						break;
 					case 1:
-						parkspace_info.set_parkspace_status(message::Parkspace_status::eParkspace_occupied);
+						parkspace_info.set_parkingspace_status(message::Parkspace_status::eParkspace_occupied);
 						break;
 					case 2:
-						parkspace_info.set_parkspace_status(message::Parkspace_status::eParkspace_reserved);
+						parkspace_info.set_parkingspace_status(message::Parkspace_status::eParkspace_reserved);
 						break;
 					case 3:
-						parkspace_info.set_parkspace_status(message::Parkspace_status::eParkspace_locked);
+						parkspace_info.set_parkingspace_status(message::Parkspace_status::eParkspace_locked);
 						break;
 					case 4:
-						parkspace_info.set_parkspace_status(message::Parkspace_status::eParkspace_error);
+						parkspace_info.set_parkingspace_status(message::Parkspace_status::eParkspace_error);
 						break;
 					default:
-						parkspace_info.set_parkspace_status(message::Parkspace_status::eParkspace_error);
+						parkspace_info.set_parkingspace_status(message::Parkspace_status::eParkspace_error);
 						break;
 				}
-				parkspace_info.set_parkspace_id(tp_result->getInt("parkingSpaceID"));
-				parkspace_info.set_block_id(tp_result->getInt("parkingSpaceBlockID"));
-				parkspace_info.set_index(tp_result->getInt("parkingSpaceIndex"));
-				parkspace_info.set_direction(tp_result->getInt("parkingSpaceDirection") > 0 ? message::Direction::eForward : message::Direction::eBackward);
-				parkspace_info.set_floor(tp_result->getInt("parkingSpaceFloor"));
-				parkspace_info.set_width(tp_result->getDouble("parkSpaceWidth"));
-				parkspace_info.set_height(tp_result->getDouble("parkSpaceHeight"));
+				parkspace_info.set_parkingspace_index_id(tp_result->getInt("parkingSpaceID"));
+				parkspace_info.set_parkingspace_unit_id(tp_result->getInt("parkingspace_unit_id"));
+				parkspace_info.set_parkingspace_room_id(tp_result->getInt("parkingspace_room_id"));
+				parkspace_info.set_parkingspace_direction(tp_result->getInt("parkingspace_direction") > 0 ? message::Direction::eForward : message::Direction::eBackward);
+				parkspace_info.set_parkingspace_floor_id(tp_result->getInt("parkingspace_floor_id"));
+				parkspace_info.set_parkingspace_width(tp_result->getDouble("parkingspace_width"));
+				parkspace_info.set_parkingspace_height(tp_result->getDouble("parkingspace_height"));
 
 				parkspace_info.mutable_car_info()->set_license(tp_result->getString("parkSpaceCarLicense"));
 				parkspace_info.mutable_car_info()->set_car_length(tp_result->getDouble("parkSpaceCarLength"));
@@ -523,7 +607,7 @@ Error_manager Parkspace_operating_function::query_one_parkspace_with_license(std
 Error_manager Parkspace_operating_function::query_one_empty_parkspace(message::Parkspace_info &parkspace_info)
 {
 	//执行sql操作
-	std::string query_parkspace_sql = std::string("select * from parkingspace where parkingSpaceState=0");
+	std::string query_parkspace_sql = std::string("select * from parkingspace where parkingspace_status=0");
 	boost::shared_ptr<sql::ResultSet>  tp_result = nullptr;
 	Error_manager ec = Database_controller::get_instance_pointer()->sql_query(query_parkspace_sql, tp_result);
 	if(ec == SUCCESS)
@@ -538,19 +622,19 @@ Error_manager Parkspace_operating_function::query_one_empty_parkspace(message::P
 			memset(buf, 0, 1024);
 			try
 			{
-				if ( tp_result->getInt("parkingSpaceState") != message::Parkspace_status::eParkspace_empty )
+				if ( tp_result->getInt("parkingspace_status") != message::Parkspace_status::eParkspace_empty )
 				{
 				    return Error_manager(Error_code::DB_QUERY_DATA_FAILED, Error_level::MAJOR_ERROR,
 				    					"数据库查询数据错误 Parkspace_operating_function::query_one_empty_parkspace error ");
 				}
-				parkspace_info.set_parkspace_status(message::Parkspace_status::eParkspace_empty);
-				parkspace_info.set_parkspace_id(tp_result->getInt("parkingSpaceID"));
-				parkspace_info.set_block_id(tp_result->getInt("parkingSpaceBlockID"));
-				parkspace_info.set_index(tp_result->getInt("parkingSpaceIndex"));
-				parkspace_info.set_direction(tp_result->getInt("parkingSpaceDirection") > 0 ? message::Direction::eForward : message::Direction::eBackward);
-				parkspace_info.set_floor(tp_result->getInt("parkingSpaceFloor"));
-				parkspace_info.set_width(tp_result->getDouble("parkSpaceWidth"));
-				parkspace_info.set_height(tp_result->getDouble("parkSpaceHeight"));
+				parkspace_info.set_parkingspace_status(message::Parkspace_status::eParkspace_empty);
+				parkspace_info.set_parkingspace_index_id(tp_result->getInt("parkingSpaceID"));
+				parkspace_info.set_parkingspace_unit_id(tp_result->getInt("parkingspace_unit_id"));
+				parkspace_info.set_parkingspace_room_id(tp_result->getInt("parkingspace_room_id"));
+				parkspace_info.set_parkingspace_direction(tp_result->getInt("parkingspace_direction") > 0 ? message::Direction::eForward : message::Direction::eBackward);
+				parkspace_info.set_parkingspace_floor_id(tp_result->getInt("parkingspace_floor_id"));
+				parkspace_info.set_parkingspace_width(tp_result->getDouble("parkingspace_width"));
+				parkspace_info.set_parkingspace_height(tp_result->getDouble("parkingspace_height"));
 				parkspace_info.mutable_car_info()->set_license(tp_result->getString("parkSpaceCarLicense"));
 				parkspace_info.mutable_car_info()->set_car_length(tp_result->getDouble("parkSpaceCarLength"));
 				parkspace_info.mutable_car_info()->set_car_width(tp_result->getDouble("parkSpaceCarWidth"));
@@ -653,12 +737,12 @@ Error_manager Parkspace_operating_function::query_vehicle(std::string license, m
 Error_manager Parkspace_operating_function::query_parking_record(message::Parkspace_info &parkspace_info, int &record_id)
 {
 	//执行sql操作
-	if(!parkspace_info.has_car_info() || parkspace_info.parkspace_id() <= 0)
+	if(!parkspace_info.has_car_info() || parkspace_info.parkingspace_index_id() <= 0)
 	{
 		return Error_manager(Error_code::PARAMETER_ERROR, Error_level::MINOR_ERROR,
 							" Parkspace_operating_function::query_parking_record error ");
 	}
-	std::string query_park_record_sql = std::string("select * from parkingrecords where numberPlate='").append(parkspace_info.car_info().license()).append("' and parkingSpaceID=").append(std::to_string(parkspace_info.parkspace_id())).append(" ORDER BY parkingRecordsID DESC");
+	std::string query_park_record_sql = std::string("select * from parkingrecords where numberPlate='").append(parkspace_info.car_info().license()).append("' and parkingSpaceID=").append(std::to_string(parkspace_info.parkingspace_index_id())).append(" ORDER BY parkingRecordsID DESC");
 	boost::shared_ptr<sql::ResultSet>  tp_result = nullptr;
 	Error_manager ec = Database_controller::get_instance_pointer()->sql_query(query_park_record_sql, tp_result);
 	if(ec == SUCCESS)

+ 2 - 0
parkspace_allocation/parkspace_operating_function.h

@@ -27,6 +27,8 @@ public:
     // ******** 数据库具体操作函数 *********
     // 从数据库获得所有车位信息,用于车位模块初始化
     Error_manager get_all_parkspace_info(message::Parkspace_allocation_data_msg &all_parkspace_info);
+    // 获取置顶类型车位信息,用于车位分配
+	Error_manager get_specify_the_type_parkspace_info(message::Parkspace_allocation_data_msg &all_specify_the_type_parkspace_info,int parkspace_type);
     // 清除数据库中所有车位号牌,状态全修改为空闲
     Error_manager clear_all_parkspace_info();
     // 更新数据库中车位状态--根据车位ID修改车位状态

+ 0 - 1
test/test_parkspace_sample.cpp

@@ -42,7 +42,6 @@ int main()
 	Database_controller::get_instance_pointer()->database_controller_init();
 //	Database_controller::get_instance_pointer()->database_controller_init("127.0.0.1", 3306, "wk", "123456", "test");
 
-//
     p_parkspace_allocation_communicater->communication_init();
 	p_parkspace_manage->parkspace_manager_init(4);
 //  p_parkspace_allocation_communicater->communication_bind("tcp://192.168.10.210:30005");