瀏覽代碼

20210129/*/*/*/*/

wk 4 年之前
父節點
當前提交
d9ccee3dbf
共有 35 個文件被更改,包括 1870 次插入7351 次删除
  1. 1 1
      CMakeLists.txt
  2. 35 22
      communication/communication_message.h
  3. 3 1
      communication/communication_socket_base.h
  4. 0 0
      error_code/error_code.cpp
  5. 0 0
      error_code/error_code.h
  6. 0 2564
      message/hardware_message.pb.cc
  7. 0 1758
      message/hardware_message.pb.h
  8. 0 68
      message/hardware_message.proto
  9. 134 554
      message/message_base.pb.cc
  10. 94 372
      message/message_base.pb.h
  11. 50 15
      message/message_base.proto
  12. 602 578
      message/parkspace_allocation_message.pb.cc
  13. 750 560
      message/parkspace_allocation_message.pb.h
  14. 10 13
      message/parkspace_allocation_message.proto
  15. 2 2
      parkspace_allocation/parkspace_allocation_communicator.cpp
  16. 81 68
      parkspace_allocation/parkspace_allocator.cpp
  17. 10 16
      parkspace_allocation/parkspace_allocator.h
  18. 42 4
      parkspace_allocation/parkspace_db_manager.cpp
  19. 2 0
      parkspace_allocation/parkspace_db_manager.h
  20. 4 417
      parkspace_allocation/parkspace_parameter.pb.cc
  21. 1 250
      parkspace_allocation/parkspace_parameter.pb.h
  22. 0 7
      parkspace_allocation/parkspace_parameter.proto
  23. 5 3
      proto.sh
  24. 0 12
      setting/parkspace_config.prototxt
  25. 31 49
      test/parkspace_client.cpp
  26. 12 16
      test/test_parkspace_sample.cpp
  27. 0 0
      tool/binary_buf.cpp
  28. 0 0
      tool/binary_buf.h
  29. 0 0
      tool/binary_buf.puml
  30. 0 0
      tool/thread_condition.cpp
  31. 1 1
      tool/thread_condition.h
  32. 0 0
      tool/thread_condition.puml
  33. 0 0
      tool/thread_safe_queue.cpp
  34. 0 0
      tool/thread_safe_queue.h
  35. 0 0
      tool/thread_safe_queue.puml

+ 1 - 1
CMakeLists.txt

@@ -7,7 +7,7 @@ set(PCL_DIR "/home/youchen/pcl-1.8/share/pcl-1.8")
 find_package(PkgConfig REQUIRED)
 pkg_check_modules(nanomsg REQUIRED nanomsg)
 FIND_PACKAGE(Protobuf REQUIRED)
-FIND_PACKAGE(Glog REQUIRED)
+#FIND_PACKAGE(Glog REQUIRED)
 FIND_PACKAGE(OpenCV REQUIRED)
 FIND_PACKAGE(PCL REQUIRED)
 

+ 35 - 22
communication/communication_message.h

@@ -22,28 +22,41 @@ public:
 	//消息类型定义,每个在网络上传输的消息必须含有这个属性
 	enum Message_type
 	{
-		eBase_msg = 0x00,
-		eCommand_msg = 0x01, //指令消息
-
-		eLocate_status_msg = 0x11,	 //定位模块状态消息
-		eLocate_request_msg = 0x12,	 //定位请求消息
-		eLocate_response_msg = 0x13, //定位反馈消息
-
-		eHarware_statu_msg = 0x21,	  //调度模块硬件状态消息
-		eExecute_request_msg = 0x22,  //请求调度消息
-		eExecute_response_msg = 0x23, //调度结果反馈消息
-
-		eParkspace_allocation_status_msg = 0x31,   //车位分配模块状态消息,包括车位信息
-		eParkspace_allocation_request_msg = 0x32,  //请求分配车位消息
-		eParkspace_allocation_response_msg = 0x33, //分配车位结果反馈消息
-		eParkspace_search_request_msg = 0x34,		//查询车位请求消息
-		eParkspace_search_response_msg = 0x35,		//查询车位反馈消息
-		eParkspace_release_request_msg = 0x36,		//释放车位请求消息
-		eParkspace_release_response_msg = 0x37,		//释放车位反馈消息
-		eParkspace_force_update_request_msg = 0x38,	//手动修改车位消息
-		eParkspace_force_update_response_msg = 0x39,//手动修改车位反馈消息
-		eParkspace_confirm_alloc_request_msg = 0x3a,//确认分配车位请求消息
-		eParkspace_confirm_alloc_response_msg = 0x3b,//确认分配车位反馈消息
+		eBase_msg=0x00,
+		eCommand_msg=0x01,                      //指令消息
+
+		eLocate_status_msg=0x11,                //定位模块状态消息
+		eLocate_request_msg=0x12,               //定位请求消息
+		eLocate_response_msg=0x13,              //定位反馈消息
+
+        eDispatch_status_msg=0x21,                //调度模块硬件状态消息
+        eDispatch_request_msg=0x22,              //请求调度消息
+        eDispatch_response_msg=0x23,             //调度结果反馈消息
+
+        eParkspace_allocation_status_msg = 0x31,   //车位分配模块状态消息,包括车位信息
+        eParkspace_allocation_request_msg = 0x32,  //请求分配车位消息
+        eParkspace_allocation_response_msg = 0x33, //分配车位结果反馈消息
+        eParkspace_search_request_msg = 0x34,    //查询车位请求消息
+        eParkspace_search_response_msg = 0x35,    //查询车位反馈消息
+        eParkspace_release_request_msg = 0x36,    //释放车位请求消息
+        eParkspace_release_response_msg = 0x37,    //释放车位反馈消息
+        eParkspace_force_update_request_msg = 0x38,	//手动修改车位消息
+        eParkspace_force_update_response_msg = 0x39,//手动修改车位反馈消息
+        eParkspace_confirm_alloc_request_msg = 0x3A,//确认分配车位请求消息
+        eParkspace_confirm_alloc_response_msg = 0x3B,//确认分配车位反馈消息
+
+        eStore_command_request_msg=0x41,                    //终端停车请求消息
+        eStore_command_response_msg=0x42,                   //停车请求反馈消息
+        ePickup_command_request_msg=0x43,                   //取车请求消息
+        ePickup_command_response_msg=0x44,                  //取车请求反馈消息
+
+        eStoring_process_statu_msg=0x90,                    //停车进度条消息
+        ePicking_process_statu_msg=0x91,                    //取车进度消息
+
+        eCentral_controller_statu_msg=0xa0,                 //中控状态消息
+
+        eEntrance_manual_operation_msg=0xb0,            //针对出入口状态操作的手动消息
+        eProcess_manual_operation_msg=0xb1,
 	};
 
 	//通讯单元

+ 3 - 1
communication/communication_socket_base.h

@@ -29,6 +29,8 @@
 #include "../communication/communication_message.h"
 
 #include "../message/message_base.pb.h"
+#include "../message/measure_message.pb.h"
+
 
 
 #define COMMUNICATION_PARAMETER_PATH "../setting/communication.prototxt"
@@ -160,4 +162,4 @@ private:
 
 
 
-#endif //__COMMUNICATION_SOCKET_BASE__HH__
+#endif //__COMMUNICATION_SOCKET_BASE__HH__

+ 0 - 0
error_code/error_code.cpp


+ 0 - 0
error_code/error_code.h


文件差異過大導致無法顯示
+ 0 - 2564
message/hardware_message.pb.cc


文件差異過大導致無法顯示
+ 0 - 1758
message/hardware_message.pb.h


+ 0 - 68
message/hardware_message.proto

@@ -1,68 +0,0 @@
-syntax = "proto2";
-package message;
-import "message_base.proto";
-
-enum Hardware_statu        //硬件状态
-{
-    eNormal=0;             //正常且空闲
-    eBusy=1;               //工作中
-    eMiss=2;                //连接丢失
-    eError=3;              //故障报错
-
-}
-
-//硬件位置.
-message Position
-{
-    required float x=1;
-    required float y=2;
-    required float z=3;
-
-}
-
-//搬运器状态
-message Carrier_status
-{
-    required Hardware_statu             statu=1;                   //状态
-    optional int32                      command_id=2;                   //指令唯一标识符id
-    optional string                     error_description=3;       //搬运器错误信息(可无)
-    required Position                   position=4;                //搬运器位置(z表示电梯位置)
-    required bool                       empty=5;                   //是否空载
-}
-
-//搬运机构各个零部件状态
-message Harware_statu_msg
-{
-    required Message_type               msg_type=1;                 //消息类型
-    required Carrier_status             carrier1_statu=2;           //搬运器1状态
-    required Carrier_status             carrier2_statu=3;           //搬运器2状态
-    required Carrier_status             carrier3_statu=4;           //搬运器3状态
-}
-
-enum Action_type
-{
-    ePark=0;
-    ePick=1;
-}
-
-//执行搬运请求
-message Execute_request_msg
-{
-    required Base_info                   msg_info=1;         //消息类型                         //消息类型
-    required int32                      command_id=2;                   //指令唯一标识符id
-    required Action_type                action_type=3;
-    required int32                      from_id=4;
-    required int32                      destination=5;
-    required Locate_information         locate_information=6;
-}
-
-//搬运动作执行完成后反馈结果
-message Execute_response_msg
-{
-    required Base_info                   msg_info=1;                    //消息类型
-    required int32                      command_id=2;                   //指令唯一标识符id
-    required int32                      error_code=3;
-    optional string                     error_description=4;
-}
-
-

+ 134 - 554
message/message_base.pb.cc

@@ -25,11 +25,6 @@ class Base_infoDefaultTypeInternal {
   ::google::protobuf::internal::ExplicitlyConstructed<Base_info>
       _instance;
 } _Base_info_default_instance_;
-class Command_infoDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<Command_info>
-      _instance;
-} _Command_info_default_instance_;
 class Base_msgDefaultTypeInternal {
  public:
   ::google::protobuf::internal::ExplicitlyConstructed<Base_msg>
@@ -78,27 +73,6 @@ void InitDefaultsBase_info() {
   ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsBase_infoImpl);
 }
 
-void InitDefaultsCommand_infoImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::message::_Command_info_default_instance_;
-    new (ptr) ::message::Command_info();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::message::Command_info::InitAsDefaultInstance();
-}
-
-void InitDefaultsCommand_info() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsCommand_infoImpl);
-}
-
 void InitDefaultsBase_msgImpl() {
   GOOGLE_PROTOBUF_VERIFY_VERSION;
 
@@ -206,8 +180,8 @@ void InitDefaultsParkspace_info() {
   ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsParkspace_infoImpl);
 }
 
-::google::protobuf::Metadata file_level_metadata[7];
-const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[6];
+::google::protobuf::Metadata file_level_metadata[6];
+const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[8];
 
 const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Base_info, _has_bits_),
@@ -223,17 +197,6 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUT
   1,
   2,
   3,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Command_info, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Command_info, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Command_info, time_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Command_info, location_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Command_info, event_),
-  0,
-  1,
-  2,
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Base_msg, _has_bits_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Base_msg, _internal_metadata_),
   ~0u,  // no _extensions_
@@ -304,10 +267,9 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUT
   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, block_id_),
   3,
   4,
-  11,
+  10,
   5,
   6,
   7,
@@ -316,21 +278,18 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUT
   2,
   0,
   1,
-  10,
 };
 static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
   { 0, 9, sizeof(::message::Base_info)},
-  { 13, 21, sizeof(::message::Command_info)},
-  { 24, 30, sizeof(::message::Base_msg)},
-  { 31, 39, sizeof(::message::Error_manager)},
-  { 42, 56, sizeof(::message::Locate_information)},
-  { 65, 74, sizeof(::message::Car_info)},
-  { 78, 95, sizeof(::message::Parkspace_info)},
+  { 13, 19, sizeof(::message::Base_msg)},
+  { 20, 28, sizeof(::message::Error_manager)},
+  { 31, 45, sizeof(::message::Locate_information)},
+  { 54, 63, sizeof(::message::Car_info)},
+  { 67, 83, sizeof(::message::Parkspace_info)},
 };
 
 static ::google::protobuf::Message const * const file_default_instances[] = {
   reinterpret_cast<const ::google::protobuf::Message*>(&::message::_Base_info_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::message::_Command_info_default_instance_),
   reinterpret_cast<const ::google::protobuf::Message*>(&::message::_Base_msg_default_instance_),
   reinterpret_cast<const ::google::protobuf::Message*>(&::message::_Error_manager_default_instance_),
   reinterpret_cast<const ::google::protobuf::Message*>(&::message::_Locate_information_default_instance_),
@@ -354,7 +313,7 @@ void protobuf_AssignDescriptorsOnce() {
 void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
 void protobuf_RegisterTypes(const ::std::string&) {
   protobuf_AssignDescriptorsOnce();
-  ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 7);
+  ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 6);
 }
 
 void AddDescriptorsImpl() {
@@ -364,63 +323,74 @@ void AddDescriptorsImpl() {
       "nfo\022\'\n\010msg_type\030\001 \002(\0162\025.message.Message_"
       "type\022\022\n\ntimeout_ms\030\002 \001(\005\022%\n\006sender\030\003 \002(\016"
       "2\025.message.Communicator\022\'\n\010receiver\030\004 \002("
-      "\0162\025.message.Communicator\"M\n\014Command_info"
-      "\022\014\n\004time\030\001 \002(\t\022\020\n\010location\030\002 \002(\t\022\035\n\005even"
-      "t\030\003 \002(\0162\016.message.Event\"1\n\010Base_msg\022%\n\tb"
-      "ase_info\030\001 \002(\0132\022.message.Base_info\"i\n\rEr"
-      "ror_manager\022\022\n\nerror_code\030\001 \002(\005\022)\n\013error"
-      "_level\030\002 \001(\0162\024.message.Error_level\022\031\n\021er"
-      "ror_description\030\003 \001(\t\"\341\001\n\022Locate_informa"
-      "tion\022\020\n\010locate_x\030\001 \001(\002\022\020\n\010locate_y\030\002 \001(\002"
-      "\022\024\n\014locate_angle\030\003 \001(\002\022\025\n\rlocate_length\030"
-      "\004 \001(\002\022\024\n\014locate_width\030\005 \001(\002\022\025\n\rlocate_he"
-      "ight\030\006 \001(\002\022\031\n\021locate_wheel_base\030\007 \001(\002\022\032\n"
-      "\022locate_wheel_width\030\010 \001(\002\022\026\n\016locate_corr"
-      "ect\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\014"
-      "parkspace_id\030\001 \001(\005\022\r\n\005index\030\002 \001(\005\022%\n\tdir"
-      "ection\030\003 \001(\0162\022.message.Direction\022\r\n\005floo"
-      "r\030\004 \001(\005\022\016\n\006length\030\005 \001(\002\022\r\n\005width\030\006 \001(\002\022\016"
-      "\n\006height\030\007 \001(\002\0223\n\020parkspace_status\030\010 \001(\016"
-      "2\031.message.Parkspace_status\022#\n\010car_info\030"
-      "\t \001(\0132\021.message.Car_info\022\022\n\nentry_time\030\n"
-      " \001(\t\022\022\n\nleave_time\030\013 \001(\t\022\020\n\010block_id\030\014 \001"
-      "(\005*\276\006\n\014Message_type\022\r\n\teBase_msg\020\000\022\020\n\014eC"
-      "ommand_msg\020\001\022\026\n\022eLocate_status_msg\020\021\022\027\n\023"
-      "eLocate_request_msg\020\022\022\030\n\024eLocate_respons"
-      "e_msg\020\023\022\030\n\024eDispatch_status_msg\020!\022\031\n\025eDi"
-      "spatch_request_msg\020\"\022\032\n\026eDispatch_respon"
-      "se_msg\020#\022$\n eParkspace_allocation_status"
-      "_msg\0201\022%\n!eParkspace_allocation_request_"
-      "msg\0202\022&\n\"eParkspace_allocation_response_"
-      "msg\0203\022!\n\035eParkspace_search_request_msg\0204"
-      "\022\"\n\036eParkspace_search_response_msg\0205\022\"\n\036"
-      "eParkspace_release_request_msg\0206\022#\n\037ePar"
-      "kspace_release_response_msg\0207\022\'\n#eParksp"
-      "ace_force_update_request_msg\0208\022(\n$eParks"
-      "pace_force_update_response_msg\0209\022(\n$ePar"
-      "kspace_confirm_alloc_request_msg\020:\022)\n%eP"
-      "arkspace_confirm_alloc_response_msg\020;\022\036\n"
-      "\032eStore_command_request_msg\020A\022\037\n\033eStore_"
-      "command_response_msg\020B\022\037\n\033ePickup_comman"
-      "d_request_msg\020C\022 \n\034ePickup_command_respo"
-      "nse_msg\020D\022\037\n\032eStoring_process_statu_msg\020"
-      "\220\001\022\037\n\032ePicking_process_statu_msg\020\221\001*f\n\014C"
-      "ommunicator\022\n\n\006eEmpty\020\000\022\t\n\005eMain\020\001\022\016\n\teT"
-      "erminor\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\005Event\022\014\n\010eStoring"
-      "\020\001\022\014\n\010ePicking\020\002*e\n\013Error_level\022\n\n\006NORMA"
-      "L\020\000\022\024\n\020NEGLIGIBLE_ERROR\020\001\022\017\n\013MINOR_ERROR"
-      "\020\002\022\017\n\013MAJOR_ERROR\020\003\022\022\n\016CRITICAL_ERROR\020\004*"
-      "\207\001\n\020Parkspace_status\022\024\n\020eParkspace_empty"
-      "\020\000\022\027\n\023eParkspace_occupied\020\001\022\027\n\023eParkspac"
-      "e_reserved\020\002\022\025\n\021eParkspace_locked\020\003\022\024\n\020e"
-      "Parkspace_error\020\004*(\n\tDirection\022\014\n\010eForwa"
-      "rd\020\001\022\r\n\teBackward\020\002"
+      "\0162\025.message.Communicator\"1\n\010Base_msg\022%\n\t"
+      "base_info\030\001 \002(\0132\022.message.Base_info\"i\n\rE"
+      "rror_manager\022\022\n\nerror_code\030\001 \002(\005\022)\n\013erro"
+      "r_level\030\002 \001(\0162\024.message.Error_level\022\031\n\021e"
+      "rror_description\030\003 \001(\t\"\341\001\n\022Locate_inform"
+      "ation\022\020\n\010locate_x\030\001 \001(\002\022\020\n\010locate_y\030\002 \001("
+      "\002\022\024\n\014locate_angle\030\003 \001(\002\022\025\n\rlocate_length"
+      "\030\004 \001(\002\022\024\n\014locate_width\030\005 \001(\002\022\025\n\rlocate_h"
+      "eight\030\006 \001(\002\022\031\n\021locate_wheel_base\030\007 \001(\002\022\032"
+      "\n\022locate_wheel_width\030\010 \001(\002\022\026\n\016locate_cor"
+      "rect\030\t \001(\010\"V\n\010Car_info\022\022\n\ncar_length\030\001 \001"
+      "(\002\022\021\n\tcar_width\030\002 \001(\002\022\022\n\ncar_height\030\003 \001("
+      "\002\022\017\n\007license\030\004 \001(\t\"\234\002\n\016Parkspace_info\022\024\n"
+      "\014parkspace_id\030\001 \001(\005\022\r\n\005index\030\002 \001(\005\022%\n\tdi"
+      "rection\030\003 \001(\0162\022.message.Direction\022\r\n\005flo"
+      "or\030\004 \001(\005\022\016\n\006length\030\005 \001(\002\022\r\n\005width\030\006 \001(\002\022"
+      "\016\n\006height\030\007 \001(\002\0223\n\020parkspace_status\030\010 \001("
+      "\0162\031.message.Parkspace_status\022#\n\010car_info"
+      "\030\t \001(\0132\021.message.Car_info\022\022\n\nentry_time\030"
+      "\n \001(\t\022\022\n\nleave_time\030\013 \001(\t*\253\007\n\014Message_ty"
+      "pe\022\r\n\teBase_msg\020\000\022\020\n\014eCommand_msg\020\001\022\026\n\022e"
+      "Locate_status_msg\020\021\022\027\n\023eLocate_request_m"
+      "sg\020\022\022\030\n\024eLocate_response_msg\020\023\022\030\n\024eDispa"
+      "tch_status_msg\020!\022\031\n\025eDispatch_request_ms"
+      "g\020\"\022\032\n\026eDispatch_response_msg\020#\022$\n ePark"
+      "space_allocation_status_msg\0201\022%\n!eParksp"
+      "ace_allocation_request_msg\0202\022&\n\"eParkspa"
+      "ce_allocation_response_msg\0203\022!\n\035eParkspa"
+      "ce_search_request_msg\0204\022\"\n\036eParkspace_se"
+      "arch_response_msg\0205\022\"\n\036eParkspace_releas"
+      "e_request_msg\0206\022#\n\037eParkspace_release_re"
+      "sponse_msg\0207\022\'\n#eParkspace_force_update_"
+      "request_msg\0208\022(\n$eParkspace_force_update"
+      "_response_msg\0209\022(\n$eParkspace_confirm_al"
+      "loc_request_msg\020:\022)\n%eParkspace_confirm_"
+      "alloc_response_msg\020;\022\036\n\032eStore_command_r"
+      "equest_msg\020A\022\037\n\033eStore_command_response_"
+      "msg\020B\022\037\n\033ePickup_command_request_msg\020C\022 "
+      "\n\034ePickup_command_response_msg\020D\022\037\n\032eSto"
+      "ring_process_statu_msg\020\220\001\022\037\n\032ePicking_pr"
+      "ocess_statu_msg\020\221\001\022\"\n\035eCentral_controlle"
+      "r_statu_msg\020\240\001\022#\n\036eEntrance_manual_opera"
+      "tion_msg\020\260\001\022\"\n\035eProcess_manual_operation"
+      "_msg\020\261\001*f\n\014Communicator\022\n\n\006eEmpty\020\000\022\t\n\005e"
+      "Main\020\001\022\016\n\teTerminor\020\200\002\022\017\n\neParkspace\020\200\004\022"
+      "\016\n\teMeasurer\020\200\006\022\016\n\teDispatch\020\200\010**\n\014Proce"
+      "ss_type\022\014\n\010eStoring\020\001\022\014\n\010ePicking\020\002*e\n\013E"
+      "rror_level\022\n\n\006NORMAL\020\000\022\024\n\020NEGLIGIBLE_ERR"
+      "OR\020\001\022\017\n\013MINOR_ERROR\020\002\022\017\n\013MAJOR_ERROR\020\003\022\022"
+      "\n\016CRITICAL_ERROR\020\004*\207\001\n\020Parkspace_status\022"
+      "\024\n\020eParkspace_empty\020\000\022\027\n\023eParkspace_occu"
+      "pied\020\001\022\027\n\023eParkspace_reserved\020\002\022\025\n\021ePark"
+      "space_locked\020\003\022\024\n\020eParkspace_error\020\004*(\n\t"
+      "Direction\022\014\n\010eForward\020\001\022\r\n\teBackward\020\002*\335"
+      "\002\n\tStep_type\022\017\n\013eAlloc_step\020\000\022\021\n\reMeasur"
+      "e_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_st"
+      "ep\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\021eBackConfirm_step\020\t\022\026\n"
+      "\022eBack_compare_step\020\n\022\025\n\021eBackMeasure_st"
+      "ep\020\013\022\023\n\017eBackAlloc_step\020\014\022\022\n\016eBackWait_s"
+      "tep\020\r\022\026\n\022eBackDispatch_step\020\016\022\024\n\020eBackSe"
+      "arch_step\020\017\022\021\n\reBackComplete\020\020*C\n\nStep_s"
+      "tatu\022\014\n\010eWaiting\020\000\022\014\n\010eWorking\020\001\022\n\n\006eErr"
+      "or\020\002\022\r\n\teFinished\020\003"
   };
   ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
-      descriptor, 2299);
+      descriptor, 2739);
   ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
     "message_base.proto", &protobuf_RegisterTypes);
 }
@@ -468,6 +438,9 @@ bool Message_type_IsValid(int value) {
     case 68:
     case 144:
     case 145:
+    case 160:
+    case 176:
+    case 177:
       return true;
     default:
       return false;
@@ -492,11 +465,11 @@ bool Communicator_IsValid(int value) {
   }
 }
 
-const ::google::protobuf::EnumDescriptor* Event_descriptor() {
+const ::google::protobuf::EnumDescriptor* Process_type_descriptor() {
   protobuf_message_5fbase_2eproto::protobuf_AssignDescriptorsOnce();
   return protobuf_message_5fbase_2eproto::file_level_enum_descriptors[2];
 }
-bool Event_IsValid(int value) {
+bool Process_type_IsValid(int value) {
   switch (value) {
     case 1:
     case 2:
@@ -554,6 +527,51 @@ bool Direction_IsValid(int value) {
   }
 }
 
+const ::google::protobuf::EnumDescriptor* Step_type_descriptor() {
+  protobuf_message_5fbase_2eproto::protobuf_AssignDescriptorsOnce();
+  return protobuf_message_5fbase_2eproto::file_level_enum_descriptors[6];
+}
+bool Step_type_IsValid(int value) {
+  switch (value) {
+    case 0:
+    case 1:
+    case 2:
+    case 3:
+    case 4:
+    case 5:
+    case 6:
+    case 7:
+    case 8:
+    case 9:
+    case 10:
+    case 11:
+    case 12:
+    case 13:
+    case 14:
+    case 15:
+    case 16:
+      return true;
+    default:
+      return false;
+  }
+}
+
+const ::google::protobuf::EnumDescriptor* Step_statu_descriptor() {
+  protobuf_message_5fbase_2eproto::protobuf_AssignDescriptorsOnce();
+  return protobuf_message_5fbase_2eproto::file_level_enum_descriptors[7];
+}
+bool Step_statu_IsValid(int value) {
+  switch (value) {
+    case 0:
+    case 1:
+    case 2:
+    case 3:
+      return true;
+    default:
+      return false;
+  }
+}
+
 
 // ===================================================================
 
@@ -963,408 +981,6 @@ void Base_info::InternalSwap(Base_info* other) {
 }
 
 
-// ===================================================================
-
-void Command_info::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int Command_info::kTimeFieldNumber;
-const int Command_info::kLocationFieldNumber;
-const int Command_info::kEventFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-Command_info::Command_info()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_message_5fbase_2eproto::InitDefaultsCommand_info();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:message.Command_info)
-}
-Command_info::Command_info(const Command_info& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  time_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_time()) {
-    time_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.time_);
-  }
-  location_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_location()) {
-    location_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.location_);
-  }
-  event_ = from.event_;
-  // @@protoc_insertion_point(copy_constructor:message.Command_info)
-}
-
-void Command_info::SharedCtor() {
-  _cached_size_ = 0;
-  time_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  location_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  event_ = 1;
-}
-
-Command_info::~Command_info() {
-  // @@protoc_insertion_point(destructor:message.Command_info)
-  SharedDtor();
-}
-
-void Command_info::SharedDtor() {
-  time_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  location_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-
-void Command_info::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* Command_info::descriptor() {
-  ::protobuf_message_5fbase_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_message_5fbase_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const Command_info& Command_info::default_instance() {
-  ::protobuf_message_5fbase_2eproto::InitDefaultsCommand_info();
-  return *internal_default_instance();
-}
-
-Command_info* Command_info::New(::google::protobuf::Arena* arena) const {
-  Command_info* n = new Command_info;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
-}
-
-void Command_info::Clear() {
-// @@protoc_insertion_point(message_clear_start:message.Command_info)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  // Prevent compiler warnings about cached_has_bits being unused
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 7u) {
-    if (cached_has_bits & 0x00000001u) {
-      GOOGLE_DCHECK(!time_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*time_.UnsafeRawStringPointer())->clear();
-    }
-    if (cached_has_bits & 0x00000002u) {
-      GOOGLE_DCHECK(!location_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*location_.UnsafeRawStringPointer())->clear();
-    }
-    event_ = 1;
-  }
-  _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool Command_info::MergePartialFromCodedStream(
-    ::google::protobuf::io::CodedInputStream* input) {
-#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
-  ::google::protobuf::uint32 tag;
-  // @@protoc_insertion_point(parse_start:message.Command_info)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
-      // required string time = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_time()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->time().data(), static_cast<int>(this->time().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "message.Command_info.time");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // required string location = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_location()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->location().data(), static_cast<int>(this->location().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "message.Command_info.location");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // required .message.Event event = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::message::Event_IsValid(value)) {
-            set_event(static_cast< ::message::Event >(value));
-          } else {
-            mutable_unknown_fields()->AddVarint(
-                3, static_cast< ::google::protobuf::uint64>(value));
-          }
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      default: {
-      handle_unusual:
-        if (tag == 0) {
-          goto success;
-        }
-        DO_(::google::protobuf::internal::WireFormat::SkipField(
-              input, tag, _internal_metadata_.mutable_unknown_fields()));
-        break;
-      }
-    }
-  }
-success:
-  // @@protoc_insertion_point(parse_success:message.Command_info)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:message.Command_info)
-  return false;
-#undef DO_
-}
-
-void Command_info::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:message.Command_info)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // required string time = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->time().data(), static_cast<int>(this->time().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "message.Command_info.time");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->time(), output);
-  }
-
-  // required string location = 2;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->location().data(), static_cast<int>(this->location().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "message.Command_info.location");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      2, this->location(), output);
-  }
-
-  // required .message.Event event = 3;
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      3, this->event(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:message.Command_info)
-}
-
-::google::protobuf::uint8* Command_info::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:message.Command_info)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // required string time = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->time().data(), static_cast<int>(this->time().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "message.Command_info.time");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        1, this->time(), target);
-  }
-
-  // required string location = 2;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->location().data(), static_cast<int>(this->location().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "message.Command_info.location");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        2, this->location(), target);
-  }
-
-  // required .message.Event event = 3;
-  if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      3, this->event(), target);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
-  }
-  // @@protoc_insertion_point(serialize_to_array_end:message.Command_info)
-  return target;
-}
-
-size_t Command_info::RequiredFieldsByteSizeFallback() const {
-// @@protoc_insertion_point(required_fields_byte_size_fallback_start:message.Command_info)
-  size_t total_size = 0;
-
-  if (has_time()) {
-    // required string time = 1;
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->time());
-  }
-
-  if (has_location()) {
-    // required string location = 2;
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->location());
-  }
-
-  if (has_event()) {
-    // required .message.Event event = 3;
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::EnumSize(this->event());
-  }
-
-  return total_size;
-}
-size_t Command_info::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:message.Command_info)
-  size_t total_size = 0;
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
-  if (((_has_bits_[0] & 0x00000007) ^ 0x00000007) == 0) {  // All required fields are present.
-    // required string time = 1;
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->time());
-
-    // required string location = 2;
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->location());
-
-    // required .message.Event event = 3;
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::EnumSize(this->event());
-
-  } else {
-    total_size += RequiredFieldsByteSizeFallback();
-  }
-  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = cached_size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-  return total_size;
-}
-
-void Command_info::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:message.Command_info)
-  GOOGLE_DCHECK_NE(&from, this);
-  const Command_info* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const Command_info>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:message.Command_info)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:message.Command_info)
-    MergeFrom(*source);
-  }
-}
-
-void Command_info::MergeFrom(const Command_info& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:message.Command_info)
-  GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 7u) {
-    if (cached_has_bits & 0x00000001u) {
-      set_has_time();
-      time_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.time_);
-    }
-    if (cached_has_bits & 0x00000002u) {
-      set_has_location();
-      location_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.location_);
-    }
-    if (cached_has_bits & 0x00000004u) {
-      event_ = from.event_;
-    }
-    _has_bits_[0] |= cached_has_bits;
-  }
-}
-
-void Command_info::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:message.Command_info)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-void Command_info::CopyFrom(const Command_info& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:message.Command_info)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-bool Command_info::IsInitialized() const {
-  if ((_has_bits_[0] & 0x00000007) != 0x00000007) return false;
-  return true;
-}
-
-void Command_info::Swap(Command_info* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
-void Command_info::InternalSwap(Command_info* other) {
-  using std::swap;
-  time_.Swap(&other->time_);
-  location_.Swap(&other->location_);
-  swap(event_, other->event_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-}
-
-::google::protobuf::Metadata Command_info::GetMetadata() const {
-  protobuf_message_5fbase_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_message_5fbase_2eproto::file_level_metadata[kIndexInFileMessages];
-}
-
-
 // ===================================================================
 
 void Base_msg::InitAsDefaultInstance() {
@@ -2913,7 +2529,6 @@ const int Parkspace_info::kParkspaceStatusFieldNumber;
 const int Parkspace_info::kCarInfoFieldNumber;
 const int Parkspace_info::kEntryTimeFieldNumber;
 const int Parkspace_info::kLeaveTimeFieldNumber;
-const int Parkspace_info::kBlockIdFieldNumber;
 #endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
 
 Parkspace_info::Parkspace_info()
@@ -2954,8 +2569,8 @@ 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*>(&block_id_) -
-      reinterpret_cast<char*>(&car_info_)) + sizeof(block_id_));
+      reinterpret_cast<char*>(&parkspace_status_) -
+      reinterpret_cast<char*>(&car_info_)) + sizeof(parkspace_status_));
   direction_ = 1;
 }
 
@@ -3019,10 +2634,10 @@ void Parkspace_info::Clear() {
         reinterpret_cast<char*>(&width_) -
         reinterpret_cast<char*>(&parkspace_id_)) + sizeof(width_));
   }
-  if (cached_has_bits & 3840u) {
+  if (cached_has_bits & 1792u) {
     ::memset(&height_, 0, static_cast<size_t>(
-        reinterpret_cast<char*>(&block_id_) -
-        reinterpret_cast<char*>(&height_)) + sizeof(block_id_));
+        reinterpret_cast<char*>(&parkspace_status_) -
+        reinterpret_cast<char*>(&height_)) + sizeof(parkspace_status_));
     direction_ = 1;
   }
   _has_bits_.Clear();
@@ -3207,20 +2822,6 @@ bool Parkspace_info::MergePartialFromCodedStream(
         break;
       }
 
-      // optional int32 block_id = 12;
-      case 12: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(96u /* 96 & 0xFF */)) {
-          set_has_block_id();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &block_id_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
       default: {
       handle_unusual:
         if (tag == 0) {
@@ -3259,7 +2860,7 @@ void Parkspace_info::SerializeWithCachedSizes(
   }
 
   // optional .message.Direction direction = 3;
-  if (cached_has_bits & 0x00000800u) {
+  if (cached_has_bits & 0x00000400u) {
     ::google::protobuf::internal::WireFormatLite::WriteEnum(
       3, this->direction(), output);
   }
@@ -3316,11 +2917,6 @@ void Parkspace_info::SerializeWithCachedSizes(
       11, this->leave_time(), output);
   }
 
-  // optional int32 block_id = 12;
-  if (cached_has_bits & 0x00000400u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(12, this->block_id(), output);
-  }
-
   if (_internal_metadata_.have_unknown_fields()) {
     ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
         _internal_metadata_.unknown_fields(), output);
@@ -3347,7 +2943,7 @@ void Parkspace_info::SerializeWithCachedSizes(
   }
 
   // optional .message.Direction direction = 3;
-  if (cached_has_bits & 0x00000800u) {
+  if (cached_has_bits & 0x00000400u) {
     target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
       3, this->direction(), target);
   }
@@ -3407,11 +3003,6 @@ void Parkspace_info::SerializeWithCachedSizes(
         11, this->leave_time(), target);
   }
 
-  // optional int32 block_id = 12;
-  if (cached_has_bits & 0x00000400u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(12, this->block_id(), target);
-  }
-
   if (_internal_metadata_.have_unknown_fields()) {
     target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
         _internal_metadata_.unknown_fields(), target);
@@ -3483,7 +3074,7 @@ size_t Parkspace_info::ByteSizeLong() const {
     }
 
   }
-  if (_has_bits_[8 / 32] & 3840u) {
+  if (_has_bits_[8 / 32] & 1792u) {
     // optional float height = 7;
     if (has_height()) {
       total_size += 1 + 4;
@@ -3495,13 +3086,6 @@ size_t Parkspace_info::ByteSizeLong() const {
         ::google::protobuf::internal::WireFormatLite::EnumSize(this->parkspace_status());
     }
 
-    // optional int32 block_id = 12;
-    if (has_block_id()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->block_id());
-    }
-
     // optional .message.Direction direction = 3;
     if (has_direction()) {
       total_size += 1 +
@@ -3568,7 +3152,7 @@ void Parkspace_info::MergeFrom(const Parkspace_info& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-  if (cached_has_bits & 3840u) {
+  if (cached_has_bits & 1792u) {
     if (cached_has_bits & 0x00000100u) {
       height_ = from.height_;
     }
@@ -3576,9 +3160,6 @@ void Parkspace_info::MergeFrom(const Parkspace_info& from) {
       parkspace_status_ = from.parkspace_status_;
     }
     if (cached_has_bits & 0x00000400u) {
-      block_id_ = from.block_id_;
-    }
-    if (cached_has_bits & 0x00000800u) {
       direction_ = from.direction_;
     }
     _has_bits_[0] |= cached_has_bits;
@@ -3619,7 +3200,6 @@ void Parkspace_info::InternalSwap(Parkspace_info* other) {
   swap(width_, other->width_);
   swap(height_, other->height_);
   swap(parkspace_status_, other->parkspace_status_);
-  swap(block_id_, other->block_id_);
   swap(direction_, other->direction_);
   swap(_has_bits_[0], other->_has_bits_[0]);
   _internal_metadata_.Swap(&other->_internal_metadata_);

+ 94 - 372
message/message_base.pb.h

@@ -37,7 +37,7 @@ namespace protobuf_message_5fbase_2eproto {
 struct TableStruct {
   static const ::google::protobuf::internal::ParseTableField entries[];
   static const ::google::protobuf::internal::AuxillaryParseTableField aux[];
-  static const ::google::protobuf::internal::ParseTable schema[7];
+  static const ::google::protobuf::internal::ParseTable schema[6];
   static const ::google::protobuf::internal::FieldMetadata field_metadata[];
   static const ::google::protobuf::internal::SerializationTable serialization_table[];
   static const ::google::protobuf::uint32 offsets[];
@@ -45,8 +45,6 @@ struct TableStruct {
 void AddDescriptors();
 void InitDefaultsBase_infoImpl();
 void InitDefaultsBase_info();
-void InitDefaultsCommand_infoImpl();
-void InitDefaultsCommand_info();
 void InitDefaultsBase_msgImpl();
 void InitDefaultsBase_msg();
 void InitDefaultsError_managerImpl();
@@ -59,7 +57,6 @@ void InitDefaultsParkspace_infoImpl();
 void InitDefaultsParkspace_info();
 inline void InitDefaults() {
   InitDefaultsBase_info();
-  InitDefaultsCommand_info();
   InitDefaultsBase_msg();
   InitDefaultsError_manager();
   InitDefaultsLocate_information();
@@ -77,9 +74,6 @@ extern Base_msgDefaultTypeInternal _Base_msg_default_instance_;
 class Car_info;
 class Car_infoDefaultTypeInternal;
 extern Car_infoDefaultTypeInternal _Car_info_default_instance_;
-class Command_info;
-class Command_infoDefaultTypeInternal;
-extern Command_infoDefaultTypeInternal _Command_info_default_instance_;
 class Error_manager;
 class Error_managerDefaultTypeInternal;
 extern Error_managerDefaultTypeInternal _Error_manager_default_instance_;
@@ -117,11 +111,14 @@ enum Message_type {
   ePickup_command_request_msg = 67,
   ePickup_command_response_msg = 68,
   eStoring_process_statu_msg = 144,
-  ePicking_process_statu_msg = 145
+  ePicking_process_statu_msg = 145,
+  eCentral_controller_statu_msg = 160,
+  eEntrance_manual_operation_msg = 176,
+  eProcess_manual_operation_msg = 177
 };
 bool Message_type_IsValid(int value);
 const Message_type Message_type_MIN = eBase_msg;
-const Message_type Message_type_MAX = ePicking_process_statu_msg;
+const Message_type Message_type_MAX = eProcess_manual_operation_msg;
 const int Message_type_ARRAYSIZE = Message_type_MAX + 1;
 
 const ::google::protobuf::EnumDescriptor* Message_type_descriptor();
@@ -157,24 +154,24 @@ inline bool Communicator_Parse(
   return ::google::protobuf::internal::ParseNamedEnum<Communicator>(
     Communicator_descriptor(), name, value);
 }
-enum Event {
+enum Process_type {
   eStoring = 1,
   ePicking = 2
 };
-bool Event_IsValid(int value);
-const Event Event_MIN = eStoring;
-const Event Event_MAX = ePicking;
-const int Event_ARRAYSIZE = Event_MAX + 1;
+bool Process_type_IsValid(int value);
+const Process_type Process_type_MIN = eStoring;
+const Process_type Process_type_MAX = ePicking;
+const int Process_type_ARRAYSIZE = Process_type_MAX + 1;
 
-const ::google::protobuf::EnumDescriptor* Event_descriptor();
-inline const ::std::string& Event_Name(Event value) {
+const ::google::protobuf::EnumDescriptor* Process_type_descriptor();
+inline const ::std::string& Process_type_Name(Process_type value) {
   return ::google::protobuf::internal::NameOfEnum(
-    Event_descriptor(), value);
+    Process_type_descriptor(), value);
 }
-inline bool Event_Parse(
-    const ::std::string& name, Event* value) {
-  return ::google::protobuf::internal::ParseNamedEnum<Event>(
-    Event_descriptor(), name, value);
+inline bool Process_type_Parse(
+    const ::std::string& name, Process_type* value) {
+  return ::google::protobuf::internal::ParseNamedEnum<Process_type>(
+    Process_type_descriptor(), name, value);
 }
 enum Error_level {
   NORMAL = 0,
@@ -239,6 +236,61 @@ inline bool Direction_Parse(
   return ::google::protobuf::internal::ParseNamedEnum<Direction>(
     Direction_descriptor(), name, value);
 }
+enum Step_type {
+  eAlloc_step = 0,
+  eMeasure_step = 1,
+  eCompare_step = 2,
+  eDispatch_step = 3,
+  eConfirm_step = 4,
+  eSearch_step = 5,
+  eWait_step = 6,
+  eRelease_step = 7,
+  eComplete = 8,
+  eBackConfirm_step = 9,
+  eBack_compare_step = 10,
+  eBackMeasure_step = 11,
+  eBackAlloc_step = 12,
+  eBackWait_step = 13,
+  eBackDispatch_step = 14,
+  eBackSearch_step = 15,
+  eBackComplete = 16
+};
+bool Step_type_IsValid(int value);
+const Step_type Step_type_MIN = eAlloc_step;
+const Step_type Step_type_MAX = eBackComplete;
+const int Step_type_ARRAYSIZE = Step_type_MAX + 1;
+
+const ::google::protobuf::EnumDescriptor* Step_type_descriptor();
+inline const ::std::string& Step_type_Name(Step_type value) {
+  return ::google::protobuf::internal::NameOfEnum(
+    Step_type_descriptor(), value);
+}
+inline bool Step_type_Parse(
+    const ::std::string& name, Step_type* value) {
+  return ::google::protobuf::internal::ParseNamedEnum<Step_type>(
+    Step_type_descriptor(), name, value);
+}
+enum Step_statu {
+  eWaiting = 0,
+  eWorking = 1,
+  eError = 2,
+  eFinished = 3
+};
+bool Step_statu_IsValid(int value);
+const Step_statu Step_statu_MIN = eWaiting;
+const Step_statu Step_statu_MAX = eFinished;
+const int Step_statu_ARRAYSIZE = Step_statu_MAX + 1;
+
+const ::google::protobuf::EnumDescriptor* Step_statu_descriptor();
+inline const ::std::string& Step_statu_Name(Step_statu value) {
+  return ::google::protobuf::internal::NameOfEnum(
+    Step_statu_descriptor(), value);
+}
+inline bool Step_statu_Parse(
+    const ::std::string& name, Step_statu* value) {
+  return ::google::protobuf::internal::ParseNamedEnum<Step_statu>(
+    Step_statu_descriptor(), name, value);
+}
 // ===================================================================
 
 class Base_info : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:message.Base_info) */ {
@@ -384,155 +436,6 @@ class Base_info : public ::google::protobuf::Message /* @@protoc_insertion_point
 };
 // -------------------------------------------------------------------
 
-class Command_info : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:message.Command_info) */ {
- public:
-  Command_info();
-  virtual ~Command_info();
-
-  Command_info(const Command_info& from);
-
-  inline Command_info& operator=(const Command_info& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
-  Command_info(Command_info&& from) noexcept
-    : Command_info() {
-    *this = ::std::move(from);
-  }
-
-  inline Command_info& operator=(Command_info&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
-    } else {
-      CopyFrom(from);
-    }
-    return *this;
-  }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
-  }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
-  }
-
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const Command_info& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
-  static inline const Command_info* internal_default_instance() {
-    return reinterpret_cast<const Command_info*>(
-               &_Command_info_default_instance_);
-  }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
-    1;
-
-  void Swap(Command_info* other);
-  friend void swap(Command_info& a, Command_info& b) {
-    a.Swap(&b);
-  }
-
-  // implements Message ----------------------------------------------
-
-  inline Command_info* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  Command_info* New(::google::protobuf::Arena* arena) const PROTOBUF_FINAL;
-  void CopyFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL;
-  void MergeFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL;
-  void CopyFrom(const Command_info& from);
-  void MergeFrom(const Command_info& from);
-  void Clear() PROTOBUF_FINAL;
-  bool IsInitialized() const PROTOBUF_FINAL;
-
-  size_t ByteSizeLong() const PROTOBUF_FINAL;
-  bool MergePartialFromCodedStream(
-      ::google::protobuf::io::CodedInputStream* input) PROTOBUF_FINAL;
-  void SerializeWithCachedSizes(
-      ::google::protobuf::io::CodedOutputStream* output) const PROTOBUF_FINAL;
-  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(
-      bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL;
-  int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; }
-  private:
-  void SharedCtor();
-  void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
-  void InternalSwap(Command_info* other);
-  private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
-  }
-  public:
-
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
-
-  // nested types ----------------------------------------------------
-
-  // accessors -------------------------------------------------------
-
-  // required string time = 1;
-  bool has_time() const;
-  void clear_time();
-  static const int kTimeFieldNumber = 1;
-  const ::std::string& time() const;
-  void set_time(const ::std::string& value);
-  #if LANG_CXX11
-  void set_time(::std::string&& value);
-  #endif
-  void set_time(const char* value);
-  void set_time(const char* value, size_t size);
-  ::std::string* mutable_time();
-  ::std::string* release_time();
-  void set_allocated_time(::std::string* time);
-
-  // required string location = 2;
-  bool has_location() const;
-  void clear_location();
-  static const int kLocationFieldNumber = 2;
-  const ::std::string& location() const;
-  void set_location(const ::std::string& value);
-  #if LANG_CXX11
-  void set_location(::std::string&& value);
-  #endif
-  void set_location(const char* value);
-  void set_location(const char* value, size_t size);
-  ::std::string* mutable_location();
-  ::std::string* release_location();
-  void set_allocated_location(::std::string* location);
-
-  // required .message.Event event = 3;
-  bool has_event() const;
-  void clear_event();
-  static const int kEventFieldNumber = 3;
-  ::message::Event event() const;
-  void set_event(::message::Event value);
-
-  // @@protoc_insertion_point(class_scope:message.Command_info)
- private:
-  void set_has_time();
-  void clear_has_time();
-  void set_has_location();
-  void clear_has_location();
-  void set_has_event();
-  void clear_has_event();
-
-  // helper for ByteSizeLong()
-  size_t RequiredFieldsByteSizeFallback() const;
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::internal::ArenaStringPtr time_;
-  ::google::protobuf::internal::ArenaStringPtr location_;
-  int event_;
-  friend struct ::protobuf_message_5fbase_2eproto::TableStruct;
-  friend void ::protobuf_message_5fbase_2eproto::InitDefaultsCommand_infoImpl();
-};
-// -------------------------------------------------------------------
-
 class Base_msg : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:message.Base_msg) */ {
  public:
   Base_msg();
@@ -575,7 +478,7 @@ class Base_msg : public ::google::protobuf::Message /* @@protoc_insertion_point(
                &_Base_msg_default_instance_);
   }
   static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
-    2;
+    1;
 
   void Swap(Base_msg* other);
   friend void swap(Base_msg& a, Base_msg& b) {
@@ -687,7 +590,7 @@ class Error_manager : public ::google::protobuf::Message /* @@protoc_insertion_p
                &_Error_manager_default_instance_);
   }
   static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
-    3;
+    2;
 
   void Swap(Error_manager* other);
   friend void swap(Error_manager& a, Error_manager& b) {
@@ -825,7 +728,7 @@ class Locate_information : public ::google::protobuf::Message /* @@protoc_insert
                &_Locate_information_default_instance_);
   }
   static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
-    4;
+    3;
 
   void Swap(Locate_information* other);
   friend void swap(Locate_information& a, Locate_information& b) {
@@ -1015,7 +918,7 @@ class Car_info : public ::google::protobuf::Message /* @@protoc_insertion_point(
                &_Car_info_default_instance_);
   }
   static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
-    5;
+    4;
 
   void Swap(Car_info* other);
   friend void swap(Car_info& a, Car_info& b) {
@@ -1163,7 +1066,7 @@ class Parkspace_info : public ::google::protobuf::Message /* @@protoc_insertion_
                &_Parkspace_info_default_instance_);
   }
   static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
-    6;
+    5;
 
   void Swap(Parkspace_info* other);
   friend void swap(Parkspace_info& a, Parkspace_info& b) {
@@ -1298,13 +1201,6 @@ class Parkspace_info : public ::google::protobuf::Message /* @@protoc_insertion_
   ::message::Parkspace_status parkspace_status() const;
   void set_parkspace_status(::message::Parkspace_status value);
 
-  // optional int32 block_id = 12;
-  bool has_block_id() const;
-  void clear_block_id();
-  static const int kBlockIdFieldNumber = 12;
-  ::google::protobuf::int32 block_id() const;
-  void set_block_id(::google::protobuf::int32 value);
-
   // optional .message.Direction direction = 3;
   bool has_direction() const;
   void clear_direction();
@@ -1336,8 +1232,6 @@ class Parkspace_info : public ::google::protobuf::Message /* @@protoc_insertion_
   void clear_has_entry_time();
   void set_has_leave_time();
   void clear_has_leave_time();
-  void set_has_block_id();
-  void clear_has_block_id();
 
   ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
   ::google::protobuf::internal::HasBits<1> _has_bits_;
@@ -1352,7 +1246,6 @@ class Parkspace_info : public ::google::protobuf::Message /* @@protoc_insertion_
   float width_;
   float height_;
   int parkspace_status_;
-  ::google::protobuf::int32 block_id_;
   int direction_;
   friend struct ::protobuf_message_5fbase_2eproto::TableStruct;
   friend void ::protobuf_message_5fbase_2eproto::InitDefaultsParkspace_infoImpl();
@@ -1469,161 +1362,6 @@ inline void Base_info::set_receiver(::message::Communicator value) {
 
 // -------------------------------------------------------------------
 
-// Command_info
-
-// required string time = 1;
-inline bool Command_info::has_time() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void Command_info::set_has_time() {
-  _has_bits_[0] |= 0x00000001u;
-}
-inline void Command_info::clear_has_time() {
-  _has_bits_[0] &= ~0x00000001u;
-}
-inline void Command_info::clear_time() {
-  time_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_time();
-}
-inline const ::std::string& Command_info::time() const {
-  // @@protoc_insertion_point(field_get:message.Command_info.time)
-  return time_.GetNoArena();
-}
-inline void Command_info::set_time(const ::std::string& value) {
-  set_has_time();
-  time_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
-  // @@protoc_insertion_point(field_set:message.Command_info.time)
-}
-#if LANG_CXX11
-inline void Command_info::set_time(::std::string&& value) {
-  set_has_time();
-  time_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:message.Command_info.time)
-}
-#endif
-inline void Command_info::set_time(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_time();
-  time_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:message.Command_info.time)
-}
-inline void Command_info::set_time(const char* value, size_t size) {
-  set_has_time();
-  time_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:message.Command_info.time)
-}
-inline ::std::string* Command_info::mutable_time() {
-  set_has_time();
-  // @@protoc_insertion_point(field_mutable:message.Command_info.time)
-  return time_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-inline ::std::string* Command_info::release_time() {
-  // @@protoc_insertion_point(field_release:message.Command_info.time)
-  clear_has_time();
-  return time_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-inline void Command_info::set_allocated_time(::std::string* time) {
-  if (time != NULL) {
-    set_has_time();
-  } else {
-    clear_has_time();
-  }
-  time_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), time);
-  // @@protoc_insertion_point(field_set_allocated:message.Command_info.time)
-}
-
-// required string location = 2;
-inline bool Command_info::has_location() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void Command_info::set_has_location() {
-  _has_bits_[0] |= 0x00000002u;
-}
-inline void Command_info::clear_has_location() {
-  _has_bits_[0] &= ~0x00000002u;
-}
-inline void Command_info::clear_location() {
-  location_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_location();
-}
-inline const ::std::string& Command_info::location() const {
-  // @@protoc_insertion_point(field_get:message.Command_info.location)
-  return location_.GetNoArena();
-}
-inline void Command_info::set_location(const ::std::string& value) {
-  set_has_location();
-  location_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
-  // @@protoc_insertion_point(field_set:message.Command_info.location)
-}
-#if LANG_CXX11
-inline void Command_info::set_location(::std::string&& value) {
-  set_has_location();
-  location_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:message.Command_info.location)
-}
-#endif
-inline void Command_info::set_location(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_location();
-  location_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:message.Command_info.location)
-}
-inline void Command_info::set_location(const char* value, size_t size) {
-  set_has_location();
-  location_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:message.Command_info.location)
-}
-inline ::std::string* Command_info::mutable_location() {
-  set_has_location();
-  // @@protoc_insertion_point(field_mutable:message.Command_info.location)
-  return location_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-inline ::std::string* Command_info::release_location() {
-  // @@protoc_insertion_point(field_release:message.Command_info.location)
-  clear_has_location();
-  return location_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-inline void Command_info::set_allocated_location(::std::string* location) {
-  if (location != NULL) {
-    set_has_location();
-  } else {
-    clear_has_location();
-  }
-  location_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), location);
-  // @@protoc_insertion_point(field_set_allocated:message.Command_info.location)
-}
-
-// required .message.Event event = 3;
-inline bool Command_info::has_event() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
-}
-inline void Command_info::set_has_event() {
-  _has_bits_[0] |= 0x00000004u;
-}
-inline void Command_info::clear_has_event() {
-  _has_bits_[0] &= ~0x00000004u;
-}
-inline void Command_info::clear_event() {
-  event_ = 1;
-  clear_has_event();
-}
-inline ::message::Event Command_info::event() const {
-  // @@protoc_insertion_point(field_get:message.Command_info.event)
-  return static_cast< ::message::Event >(event_);
-}
-inline void Command_info::set_event(::message::Event value) {
-  assert(::message::Event_IsValid(value));
-  set_has_event();
-  event_ = value;
-  // @@protoc_insertion_point(field_set:message.Command_info.event)
-}
-
-// -------------------------------------------------------------------
-
 // Base_msg
 
 // required .message.Base_info base_info = 1;
@@ -2209,13 +1947,13 @@ inline void Parkspace_info::set_index(::google::protobuf::int32 value) {
 
 // optional .message.Direction direction = 3;
 inline bool Parkspace_info::has_direction() const {
-  return (_has_bits_[0] & 0x00000800u) != 0;
+  return (_has_bits_[0] & 0x00000400u) != 0;
 }
 inline void Parkspace_info::set_has_direction() {
-  _has_bits_[0] |= 0x00000800u;
+  _has_bits_[0] |= 0x00000400u;
 }
 inline void Parkspace_info::clear_has_direction() {
-  _has_bits_[0] &= ~0x00000800u;
+  _has_bits_[0] &= ~0x00000400u;
 }
 inline void Parkspace_info::clear_direction() {
   direction_ = 1;
@@ -2533,30 +2271,6 @@ inline void Parkspace_info::set_allocated_leave_time(::std::string* leave_time)
   // @@protoc_insertion_point(field_set_allocated:message.Parkspace_info.leave_time)
 }
 
-// optional int32 block_id = 12;
-inline bool Parkspace_info::has_block_id() const {
-  return (_has_bits_[0] & 0x00000400u) != 0;
-}
-inline void Parkspace_info::set_has_block_id() {
-  _has_bits_[0] |= 0x00000400u;
-}
-inline void Parkspace_info::clear_has_block_id() {
-  _has_bits_[0] &= ~0x00000400u;
-}
-inline void Parkspace_info::clear_block_id() {
-  block_id_ = 0;
-  clear_has_block_id();
-}
-inline ::google::protobuf::int32 Parkspace_info::block_id() const {
-  // @@protoc_insertion_point(field_get:message.Parkspace_info.block_id)
-  return block_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)
-}
-
 #ifdef __GNUC__
   #pragma GCC diagnostic pop
 #endif  // __GNUC__
@@ -2570,8 +2284,6 @@ inline void Parkspace_info::set_block_id(::google::protobuf::int32 value) {
 
 // -------------------------------------------------------------------
 
-// -------------------------------------------------------------------
-
 
 // @@protoc_insertion_point(namespace_scope)
 
@@ -2590,10 +2302,10 @@ template <>
 inline const EnumDescriptor* GetEnumDescriptor< ::message::Communicator>() {
   return ::message::Communicator_descriptor();
 }
-template <> struct is_proto_enum< ::message::Event> : ::google::protobuf::internal::true_type {};
+template <> struct is_proto_enum< ::message::Process_type> : ::google::protobuf::internal::true_type {};
 template <>
-inline const EnumDescriptor* GetEnumDescriptor< ::message::Event>() {
-  return ::message::Event_descriptor();
+inline const EnumDescriptor* GetEnumDescriptor< ::message::Process_type>() {
+  return ::message::Process_type_descriptor();
 }
 template <> struct is_proto_enum< ::message::Error_level> : ::google::protobuf::internal::true_type {};
 template <>
@@ -2610,6 +2322,16 @@ template <>
 inline const EnumDescriptor* GetEnumDescriptor< ::message::Direction>() {
   return ::message::Direction_descriptor();
 }
+template <> struct is_proto_enum< ::message::Step_type> : ::google::protobuf::internal::true_type {};
+template <>
+inline const EnumDescriptor* GetEnumDescriptor< ::message::Step_type>() {
+  return ::message::Step_type_descriptor();
+}
+template <> struct is_proto_enum< ::message::Step_statu> : ::google::protobuf::internal::true_type {};
+template <>
+inline const EnumDescriptor* GetEnumDescriptor< ::message::Step_statu>() {
+  return ::message::Step_statu_descriptor();
+}
 
 }  // namespace protobuf
 }  // namespace google

+ 50 - 15
message/message_base.proto

@@ -37,8 +37,15 @@ enum Message_type
 
 
 
-    eStoring_process_statu_msg=0x90;        //停车进度条消息
-    ePicking_process_statu_msg=0x91;        //取车进度消息
+    eStoring_process_statu_msg=0x90;        //停车指令进度条消息
+    ePicking_process_statu_msg=0x91;        //取车指令进度消息
+
+
+    eCentral_controller_statu_msg=0xa0;     //中控系统状态消息
+
+
+    eEntrance_manual_operation_msg=0xb0;            //针对出入口状态操作的手动消息
+    eProcess_manual_operation_msg=0xb1;             //针对流程的手动消息
 
 
 }
@@ -70,22 +77,12 @@ message Base_info
 }
 
 // 事件,停车或者取车
-enum Event
+enum Process_type
 {
     eStoring=1;
     ePicking=2;
 }
 
-// 指令信息, 包含 时间,地点,事件
-// 时间 格式为: 年-月-日:时-分-秒
-//地点格式为 :  区号-序号   楚天项目为  027-01
-message Command_info
-{
-    required string                     time=1;
-    required string                     location=2;
-    required Event                      event=3;
-
-}
 
 message Base_msg
 {
@@ -128,6 +125,7 @@ message Locate_information
     optional bool locate_correct = 9;		    //整车的校准标记位
 }
 
+//车辆基本信息
 message Car_info
 {
     optional float                      car_length=1;           //车长
@@ -152,7 +150,7 @@ enum Direction
     eBackward = 2;
 }
 
-//单个车位基本信息与状态信息
+//单个车位基本信息与状态信息,车位信息以及车位上的车辆信息
 message Parkspace_info
 {
     optional int32              parkspace_id=1;         //车位编号
@@ -166,5 +164,42 @@ message Parkspace_info
     optional Car_info           car_info=9;              //当前车位存入车辆的凭证号
     optional string             entry_time=10;          //入场时间
     optional string             leave_time=11;          //离场时间
-    optional int32              block_id=12;            //区块编号
 }
+
+/*
+*流程中的步骤类型, 例如:停车流程包含5个步骤 , 分配车位-测量-检验结果-搬运-更新车位表
+*/
+enum Step_type
+{
+    eAlloc_step=0;
+    eMeasure_step=1;
+    eCompare_step=2;
+    eDispatch_step=3;
+    eConfirm_step=4;
+
+    eSearch_step=5;        //查询数据库
+    eWait_step=6;             //等待车辆离开
+    eRelease_step=7;          //释放车位
+
+    eComplete=8;              //完成
+
+    eBackConfirm_step=9;
+    eBack_compare_step=10;
+    eBackMeasure_step=11;
+    eBackAlloc_step=12;
+
+    eBackWait_step=13;
+    eBackDispatch_step=14;
+    eBackSearch_step=15;
+
+    eBackComplete=16;
+}
+//步骤状态,每个步骤有四中可能状态 ,等待中-执行中-完成或者错误  四个状态
+enum Step_statu
+{
+    eWaiting=0;               //完成/空闲
+    eWorking=1;
+    eError=2;
+    eFinished=3;
+}
+

文件差異過大導致無法顯示
+ 602 - 578
message/parkspace_allocation_message.pb.cc


文件差異過大導致無法顯示
+ 750 - 560
message/parkspace_allocation_message.pb.h


+ 10 - 13
message/parkspace_allocation_message.proto

@@ -8,7 +8,6 @@ import "message_base.proto";
 // 3.解锁车位
 // 4.手动操作修改车位状态
 // 5.临时锁定车位
-// 6.计算费用
 
 //车辆状态枚举
 enum Vehicle_status
@@ -25,7 +24,7 @@ enum Vehicle_status
 message Parkspace_allocation_request_msg
 {
     required Base_info                  base_info=1;            //消息类型
-    required Command_info               command_info=2;           //指令唯一标识符id
+    required string                     command_key=2;           //指令唯一标识符id
     required Car_info                   car_info=3;
     required int32                      terminal_id=4;          //终端id,优化车位分配用
 }
@@ -34,7 +33,7 @@ message Parkspace_allocation_request_msg
 message Parkspace_allocation_response_msg
 {
     required Base_info                  base_info=1;            //消息类型
-    required Command_info               command_info=2;           //指令唯一标识符id
+    required string                     command_key=2;           //指令唯一标识符id
     required Error_manager              error_manager=3;        //分配成功与否标志
     required Parkspace_info             allocated_space_info=4; //分配车位信息
 }
@@ -43,7 +42,7 @@ message Parkspace_allocation_response_msg
 message Parkspace_search_request_msg
 {
     required Base_info                  base_info=1;            //消息类型
-    required Command_info               command_info=2;           //指令唯一标识符id
+    required string                     command_key=2;           //指令唯一标识符id
     required Car_info                   car_info=3;              //车辆凭证或号牌
 }
 
@@ -51,7 +50,7 @@ message Parkspace_search_request_msg
 message Parkspace_search_response_msg
 {
     required Base_info                  base_info=1;            //消息类型
-    required Command_info               command_info=2;           //指令唯一标识符id
+    required string                     command_key=2;           //指令唯一标识符id
     required Error_manager              error_manager=3;        //分配成功与否标志
     optional Parkspace_info             car_position=4;         //待查询车辆存放位置
 }
@@ -60,7 +59,7 @@ message Parkspace_search_response_msg
 message Parkspace_release_request_msg
 {
     required Base_info                  base_info=1;            //消息类型
-    required Command_info               command_info=2;           //指令唯一标识符id
+    required string                     command_key=2;           //指令唯一标识符id
     required Parkspace_info             release_space_info=3;   //待释放车位信息
 }
 
@@ -68,7 +67,7 @@ message Parkspace_release_request_msg
 message Parkspace_release_response_msg
 {
     required Base_info                  base_info=1;            //消息类型
-    required Command_info               command_info=2;           //指令唯一标识符id
+    required string                     command_key=2;           //指令唯一标识符id
     required Error_manager              error_manager=3;        //分配成功与否标志
     required Parkspace_info             release_space_info=4;   //待释放车位信息
 }
@@ -77,7 +76,7 @@ message Parkspace_release_response_msg
 message Parkspace_force_update_request_msg
 {
     required Base_info                  base_info=1;            //消息类型
-    required Command_info               command_info=2;           //指令唯一标识符id
+    required string                     command_key=2;           //指令唯一标识符id
     required Parkspace_info             update_space_info=3;    //待手动修改车位信息,通过id定位
 }
 
@@ -85,7 +84,7 @@ message Parkspace_force_update_request_msg
 message Parkspace_force_update_response_msg
 {
     required Base_info                  base_info=1;            //消息类型
-    required Command_info               command_info=2;           //指令唯一标识符id
+    required string                     command_key=2;           //指令唯一标识符id
     required Error_manager              error_manager=3;        //分配成功与否标志
     required Parkspace_info             update_space_info=4;    //已修改后的车位信息
 }
@@ -94,20 +93,18 @@ message Parkspace_force_update_response_msg
 message Parkspace_confirm_alloc_request_msg
 {
     required Base_info                  base_info=1;            //消息类型
-    required Command_info               command_info=2;           //指令唯一标识符id
+    required string                     command_key=2;           //指令唯一标识符id
     required Parkspace_info             confirm_space_info=3;    //已修改后的车位信息
 }
 
 message Parkspace_confirm_alloc_response_msg
 {
     required Base_info                  base_info=1;            //消息类型
-    required Command_info               command_info=2;           //指令唯一标识符id
+    required string                     command_key=2;           //指令唯一标识符id
     required Error_manager              error_manager=3;        //分配成功与否标志
     required Parkspace_info             confirm_alloc_space_info=4;    //已修改后的车位信息
 }
 
-// 6.计算费用
-
 // 车位心跳状态信息
 message Parkspace_allocation_status_msg
 {

+ 2 - 2
parkspace_allocation/parkspace_allocation_communicator.cpp

@@ -117,7 +117,7 @@ Error_manager Parkspace_allocation_communicator::check_msg(Communication_message
                 return Error_code::INVALID_MESSAGE;
         }
     }
-    return ERROR;
+	return Error_code::INVALID_MESSAGE;
 }
 
 Error_manager Parkspace_allocation_communicator::check_executer(Communication_message*  p_msg)
@@ -170,4 +170,4 @@ Error_manager Parkspace_allocation_communicator::encapsulate_send_data()
 							 " Parkspace_allocation_communicator::send status error ");
 	}
 	return Error_code::SUCCESS;
-}
+}

+ 81 - 68
parkspace_allocation/parkspace_allocator.cpp

@@ -2,7 +2,7 @@
  * @Description: 车位分配算法模块,使用单例模式,接收外部请求并通过调用通信块接口发送反馈
  * @Author: yct
  * @Date: 2020-07-10 11:02:40
- * @LastEditTime: 2020-09-11 12:23:48
+ * @LastEditTime: 2020-08-06 10:32:28
  * @LastEditors: yct
  */ 
 
@@ -19,7 +19,7 @@ Parkspace_allocator::~Parkspace_allocator()
 }
 
 //初始化
-Error_manager Parkspace_allocator::parkspace_allocator_init(int threads_size, parkspace_proto::garage_config config)
+Error_manager Parkspace_allocator::parkspace_allocator_init(int threads_size, parkspace_proto::database_config db_config)
 {
     // 初始化db连接
     mp_db_manager = Parkspace_db_manager::get_instance_pointer();
@@ -27,8 +27,7 @@ Error_manager Parkspace_allocator::parkspace_allocator_init(int threads_size, pa
     {
         return POINTER_IS_NULL;
     }
-    m_config.CopyFrom(config);
-    Error_manager ec = mp_db_manager->Parkspace_db_manager_init(m_config.db_config());
+    Error_manager ec = mp_db_manager->Parkspace_db_manager_init(db_config);
     if(ec != SUCCESS)
     {
         return ec;
@@ -93,7 +92,7 @@ Error_manager Parkspace_allocator::execute_msg(Communication_message* p_msg)
             }
             //往线程池添加执行任务, 之后会唤醒一个线程去执行他.
             m_thread_pool.enqueue(&Parkspace_allocator::execute_for_allocate, this,
-            request.car_info(), request.terminal_id(), request.command_info());
+            request.car_info(), request.terminal_id(), request.command_key());
             return SUCCESS;
         }
         // 车位查询请求消息
@@ -108,7 +107,7 @@ Error_manager Parkspace_allocator::execute_msg(Communication_message* p_msg)
 			    					" message::Parkspace_search_request_msg  ParseFromString error ");
             }
             //往线程池添加执行任务, 之后会唤醒一个线程去执行他.
-            m_thread_pool.enqueue(&Parkspace_allocator::execute_for_search, this, request.car_info(), request.command_info());
+            m_thread_pool.enqueue(&Parkspace_allocator::execute_for_search, this, request.car_info(), request.command_key());
             return SUCCESS;
         }
         // 车位释放请求消息
@@ -123,7 +122,7 @@ Error_manager Parkspace_allocator::execute_msg(Communication_message* p_msg)
 			    					" message::Parkspace_release_request_msg  ParseFromString error ");
             }
             //往线程池添加执行任务, 之后会唤醒一个线程去执行他.
-            m_thread_pool.enqueue(&Parkspace_allocator::execute_for_release, this, request.release_space_info(), request.command_info());
+            m_thread_pool.enqueue(&Parkspace_allocator::execute_for_release, this, request.release_space_info(), request.command_key());
             return SUCCESS;
         }
         // 车位手动更新请求消息
@@ -138,7 +137,7 @@ Error_manager Parkspace_allocator::execute_msg(Communication_message* p_msg)
 			    					" message::Parkspace_force_update_request_msg  ParseFromString error ");
             }
             //往线程池添加执行任务, 之后会唤醒一个线程去执行他.
-            m_thread_pool.enqueue(&Parkspace_allocator::execute_for_force_update, this, request.update_space_info(), request.command_info());
+            m_thread_pool.enqueue(&Parkspace_allocator::execute_for_force_update, this, request.update_space_info(), request.command_key());
             return SUCCESS;
         }
         // 车位确认占用请求消息
@@ -153,7 +152,7 @@ Error_manager Parkspace_allocator::execute_msg(Communication_message* p_msg)
 			    					" message::Parkspace_force_update_request_msg  ParseFromString error ");
             }
             //往线程池添加执行任务, 之后会唤醒一个线程去执行他.
-            m_thread_pool.enqueue(&Parkspace_allocator::execute_for_confirm_alloc, this, request.confirm_space_info(), request.command_info());
+            m_thread_pool.enqueue(&Parkspace_allocator::execute_for_confirm_alloc, this, request.confirm_space_info(), request.command_key());
             return SUCCESS;
         }
 	}
@@ -195,33 +194,8 @@ bool Parkspace_allocator::check_car_existence(std::string license, message::Park
     return false;
 }
 
-// 分配车位函数
-// input: 当前完整车位状态信息, 终端id(从0开始),
-// output: 分配的车位下标
-// 注: 区块号范围1-3
-int Parkspace_allocator::allocate_parkspace(message::Parkspace_allocation_status_msg parkspace_status, message::Car_info car_info, int terminal_id)
-{
-    for (size_t i = 0; i < parkspace_status.parkspace_info_size(); i++)
-    {
-        // 条件包括:
-        // 1.车位区块号合法,并且与终端id属于相同区块
-        // 2.宽高超过车辆尺寸
-        // 3.空闲车位
-        if (parkspace_status.parkspace_info(i).has_block_id()
-            && parkspace_status.parkspace_info(i).block_id() <= m_config.block_size()
-            && parkspace_status.parkspace_info(i).block_id() == (terminal_id / m_config.terminal_size_in_block() + 1 )
-            /* && t_current_parkspace_status.parkspace_info(i).height() > car_info.car_height() 
-            && t_current_parkspace_status.parkspace_info(i).width() > car_info.car_width() */
-            && parkspace_status.parkspace_info(i).parkspace_status() == message::Parkspace_status::eParkspace_empty)
-        {
-            return i;
-        }
-    }
-    return -1;
-}
-
 //分配车位线程函数
-void Parkspace_allocator::execute_for_allocate(message::Car_info car_info, int terminal_id, message::Command_info command_info)
+void Parkspace_allocator::execute_for_allocate(message::Car_info car_info, int terminal_id, std::string command_key)
 {
     std::lock_guard<std::mutex> lck(m_mutex);
     LOG(INFO) << "分配";
@@ -251,8 +225,19 @@ void Parkspace_allocator::execute_for_allocate(message::Car_info car_info, int t
     }
     else
     {   
-        index = allocate_parkspace(t_current_parkspace_status, car_info, terminal_id);
-
+        for (size_t i = 0; i < t_current_parkspace_status.parkspace_info_size(); i++)
+        {
+            // 找到高于车高且空闲车位,则分配
+            if (t_current_parkspace_status.parkspace_info(i).has_car_info() 
+            /* && t_current_parkspace_status.parkspace_info(i).height() > car_info.car_height() 
+            && t_current_parkspace_status.parkspace_info(i).width() > car_info.car_width() */
+            && t_current_parkspace_status.parkspace_info(i).parkspace_status() == message::Parkspace_status::eParkspace_empty)
+            {
+                index = i;
+                break;
+            }
+        }
+        
         if(index<0){
             t_error.set_error_code(PARKSPACE_ALLOCATOR_ALLOCATE_FAILED);
             t_error.set_error_level(message::Error_level::MAJOR_ERROR);
@@ -284,7 +269,7 @@ void Parkspace_allocator::execute_for_allocate(message::Car_info car_info, int t
         }
     }
     response_msg.mutable_base_info()->CopyFrom(t_response_header);
-    response_msg.mutable_command_info()->CopyFrom(command_info);
+    response_msg.set_command_key(command_key);
     response_msg.mutable_error_manager()->CopyFrom(t_error);
     response_msg.mutable_allocated_space_info()->CopyFrom(t_allocated_space);
     Communication_message response=Communication_message();
@@ -293,7 +278,7 @@ void Parkspace_allocator::execute_for_allocate(message::Car_info car_info, int t
 }
 
 //查询车位线程函数
-void Parkspace_allocator::execute_for_search(message::Car_info car_info, message::Command_info command_info)
+void Parkspace_allocator::execute_for_search(message::Car_info car_info,std::string command_key)
 {
     std::lock_guard<std::mutex> lck(m_mutex);
     LOG(INFO) << "查询";
@@ -344,7 +329,7 @@ void Parkspace_allocator::execute_for_search(message::Car_info car_info, message
         }
     }
     response_msg.mutable_base_info()->CopyFrom(t_response_header);
-    response_msg.mutable_command_info()->CopyFrom(command_info);
+    response_msg.set_command_key(command_key);
     response_msg.mutable_error_manager()->CopyFrom(t_error);
     response_msg.mutable_car_position()->CopyFrom(t_car_position);
     Communication_message response=Communication_message();
@@ -353,7 +338,7 @@ void Parkspace_allocator::execute_for_search(message::Car_info car_info, message
 }
 
 //释放车位线程函数
-void Parkspace_allocator::execute_for_release(message::Parkspace_info space_info, message::Command_info command_info)
+void Parkspace_allocator::execute_for_release(message::Parkspace_info space_info, std::string command_key)
 {
     std::lock_guard<std::mutex> lck(m_mutex);
     LOG(INFO) << "释放";
@@ -401,7 +386,7 @@ void Parkspace_allocator::execute_for_release(message::Parkspace_info space_info
             t_error.set_error_level(message::Error_level::MAJOR_ERROR);
             // 传入默认车位信息
             t_release_space.CopyFrom(space_info);
-            LOG(WARNING) << "释放车位失败";
+            LOG(WARNING) << "释放车位失败 input:"<<space_info.DebugString()<<", self:"<<t_current_parkspace_status.parkspace_info(space_info.parkspace_id()-1).DebugString();
         }else{
             t_error.set_error_code(SUCCESS);
             t_error.set_error_level(message::Error_level::NORMAL);
@@ -453,7 +438,7 @@ void Parkspace_allocator::execute_for_release(message::Parkspace_info space_info
         }
     }
     response_msg.mutable_base_info()->CopyFrom(t_response_header);
-    response_msg.mutable_command_info()->CopyFrom(command_info);
+    response_msg.set_command_key(command_key);
     response_msg.mutable_error_manager()->CopyFrom(t_error);
     response_msg.mutable_release_space_info()->CopyFrom(t_release_space);
     Communication_message response=Communication_message();
@@ -462,7 +447,7 @@ void Parkspace_allocator::execute_for_release(message::Parkspace_info space_info
 }
 
 //强制更新车位信息线程函数
-void Parkspace_allocator::execute_for_force_update(message::Parkspace_info space_info, message::Command_info command_info)
+void Parkspace_allocator::execute_for_force_update(message::Parkspace_info space_info, std::string command_key)
 {
     std::lock_guard<std::mutex> lck(m_mutex);
     LOG(INFO) << "手动";
@@ -487,37 +472,65 @@ void Parkspace_allocator::execute_for_force_update(message::Parkspace_info space
     }
     else
     {
-        for (size_t i = 0; i < t_current_parkspace_status.parkspace_info_size(); i++)
+        // id 9999为特殊情况,复位所有车位状态
+        if (space_info.parkspace_id() == 9999)
         {
-            // 找到高于车高且空闲车位,则分配
-            if (t_current_parkspace_status.parkspace_info(i).parkspace_id() == space_info.parkspace_id())
-            {
-                index = i;
-                break;
-            }
-        }
-        if(index<0){
-            t_error.set_error_code(PARKSPACE_ALLOCATOR_FORCE_UPDATE_FAILED);
-            t_error.set_error_level(message::Error_level::MAJOR_ERROR);
-            t_update_space.CopyFrom(space_info);
-            LOG(WARNING) << "手动更新车位失败";
-        }else{
             t_error.set_error_code(SUCCESS);
             t_error.set_error_level(message::Error_level::NORMAL);
             t_update_space.CopyFrom(space_info);
-            // 分配车位后更新车位状态
-            Parkspace_allocation_communicator::get_instance_references().update_parkspace_status(index, t_update_space);
-            LOG(INFO) << "第"<<index<<"号位已手动更新, id: "<<t_update_space.parkspace_id();
+            // 复位所有车位状态
+            for (size_t i = 0; i < t_current_parkspace_status.parkspace_info_size(); i++)
+            {
+                t_current_parkspace_status.mutable_parkspace_info(i)->set_parkspace_status(message::Parkspace_status::eParkspace_empty);
+                t_current_parkspace_status.mutable_parkspace_info(i)->mutable_car_info()->set_license("");
+            }
+            
+            Parkspace_allocation_communicator::get_instance_references().update_parkspace_status(t_current_parkspace_status);
+            LOG(INFO) << "所有车位已手动更新 ";
             // 数据库操作,车位状态根据手动值进行修改
-            Error_manager ec = Parkspace_db_manager::get_instance_references().update_parkspace_status(t_update_space);
-            if(ec != SUCCESS)
+            Error_manager ec = Parkspace_db_manager::get_instance_references().clean_all_parkspace_info();
+            if (ec != SUCCESS)
             {
-                LOG(ERROR) << "更新db车位状态失败: "<< ec.to_string();
+                LOG(ERROR) << "复位db车位状态失败: " << ec.to_string();
+            }
+        }
+        else
+        {
+            for (size_t i = 0; i < t_current_parkspace_status.parkspace_info_size(); i++)
+            {
+                // 找到高于车高且空闲车位,则分配
+                if (t_current_parkspace_status.parkspace_info(i).parkspace_id() == space_info.parkspace_id())
+                {
+                    index = i;
+                    break;
+                }
+            }
+            if (index < 0)
+            {
+                t_error.set_error_code(PARKSPACE_ALLOCATOR_FORCE_UPDATE_FAILED);
+                t_error.set_error_level(message::Error_level::MAJOR_ERROR);
+                t_update_space.CopyFrom(space_info);
+                LOG(WARNING) << "手动更新车位失败";
+            }
+            else
+            {
+                t_error.set_error_code(SUCCESS);
+                t_error.set_error_level(message::Error_level::NORMAL);
+                t_update_space.CopyFrom(space_info);
+                // 分配车位后更新车位状态
+                Parkspace_allocation_communicator::get_instance_references().update_parkspace_status(index, t_update_space);
+                LOG(INFO) << "第" << index << "号位已手动更新, id: " << t_update_space.parkspace_id();
+                // 数据库操作,车位状态根据手动值进行修改
+                Error_manager ec = Parkspace_db_manager::get_instance_references().update_parkspace_status(t_update_space);
+                if (ec != SUCCESS)
+                {
+                    LOG(ERROR) << "更新db车位状态失败: " << ec.to_string();
+                }
             }
         }
     }
     response_msg.mutable_base_info()->CopyFrom(t_response_header);
-    response_msg.mutable_command_info()->CopyFrom(command_info);
+    response_msg.set_command_key(command_key);
     response_msg.mutable_error_manager()->CopyFrom(t_error);
     response_msg.mutable_update_space_info()->CopyFrom(t_update_space);
     Communication_message response=Communication_message();
@@ -526,7 +539,7 @@ void Parkspace_allocator::execute_for_force_update(message::Parkspace_info space
 }
 
 //确认分配车位线程函数
-void Parkspace_allocator::execute_for_confirm_alloc(message::Parkspace_info space_info, message::Command_info command_info)
+void Parkspace_allocator::execute_for_confirm_alloc(message::Parkspace_info space_info, std::string command_key)
 {
     std::lock_guard<std::mutex> lck(m_mutex);
     LOG(INFO) << "确认分配";
@@ -572,7 +585,7 @@ void Parkspace_allocator::execute_for_confirm_alloc(message::Parkspace_info spac
             t_error.set_error_code(PARKSPACE_ALLOCATOR_CONFIRM_ALLOC_ERROR);
             t_error.set_error_level(message::Error_level::MAJOR_ERROR);
             t_confirm_space.CopyFrom(space_info);
-            LOG(WARNING) << "确认占用车位失败";
+            LOG(WARNING) << "确认占用车位失败, " << t_confirm_space.DebugString()<<", self:"<<t_current_parkspace_status.parkspace_info(space_info.parkspace_id()-1).DebugString();
         }else{
             t_error.set_error_code(SUCCESS);
             t_error.set_error_level(message::Error_level::NORMAL);
@@ -613,7 +626,7 @@ void Parkspace_allocator::execute_for_confirm_alloc(message::Parkspace_info spac
         }
     }
     response_msg.mutable_base_info()->CopyFrom(t_response_header);
-    response_msg.mutable_command_info()->CopyFrom(command_info);
+    response_msg.set_command_key(command_key);
     response_msg.mutable_error_manager()->CopyFrom(t_error);
     response_msg.mutable_confirm_alloc_space_info()->CopyFrom(t_confirm_space);
     Communication_message response=Communication_message();

+ 10 - 16
parkspace_allocation/parkspace_allocator.h

@@ -2,7 +2,7 @@
  * @Description: 车位分配算法模块,使用单例模式,接收外部请求并通过调用通信块接口发送反馈
  * @Author: yct
  * @Date: 2020-07-10 09:25:56
- * @LastEditTime: 2020-09-11 11:44:47
+ * @LastEditTime: 2020-08-06 10:18:56
  * @LastEditors: yct
  */ 
 
@@ -38,7 +38,7 @@ public:
     ~Parkspace_allocator();
 public://API functions
 	//初始化
-	Error_manager parkspace_allocator_init(int threads_size, parkspace_proto::garage_config config);
+	Error_manager parkspace_allocator_init(int threads_size, parkspace_proto::database_config db_config);
 	//反初始化
 	Error_manager parkspace_allocator_uninit();
 
@@ -56,27 +56,21 @@ public://API functions
     // 检查车辆是否已存在,通常分配前调用
     bool check_car_existence(std::string license, message::Parkspace_allocation_status_msg status_msg);
 
-private://execute_msg创建各线程进行处理
+public://execute_msg创建各线程进行处理
 	//分配车位线程函数
-    void execute_for_allocate(message::Car_info car_info, int terminal_id, message::Command_info command_info);
+    void execute_for_allocate(message::Car_info car_info, int terminal_id,std::string command_key);
     //查询车位线程函数
-    void execute_for_search(message::Car_info car_info, message::Command_info command_info);
+    void execute_for_search(message::Car_info car_info,std::string command_key);
     //释放车位线程函数
-    void execute_for_release(message::Parkspace_info space_info, message::Command_info command_info);
+    void execute_for_release(message::Parkspace_info space_info, std::string command_key);
     //强制更新车位信息线程函数
-    void execute_for_force_update(message::Parkspace_info space_info, message::Command_info command_info);
+    void execute_for_force_update(message::Parkspace_info space_info, std::string command_key);
     //确认分配车位线程函数
-    void execute_for_confirm_alloc(message::Parkspace_info space_info, message::Command_info command_info);
-
-    // 分配车位函数
-    // input: 当前完整车位状态信息, 终端id, 
-    // output: 分配的车位下标
-    int allocate_parkspace(message::Parkspace_allocation_status_msg parkspace_status, message::Car_info car_info, int terminal_id);
+    void execute_for_confirm_alloc(message::Parkspace_info space_info, std::string command_key);
 
 private:
-    parkspace_proto::garage_config m_config;                    //车位配置文件
-    parkspace_allocator_status m_current_status;                //分配器当前状态
-    Thread_pool 				m_thread_pool;					//执行多任务的线程池
+    parkspace_allocator_status  m_current_status;               //分配器当前状态
+	Thread_pool 				m_thread_pool;					//执行多任务的线程池
     std::mutex                  m_mutex;                        //车位变动锁
     Parkspace_db_manager*       mp_db_manager;                  //车位模块数据库管理句柄
 

+ 42 - 4
parkspace_allocation/parkspace_db_manager.cpp

@@ -2,7 +2,7 @@
  * @Description: 车位数据库管理
  * @Author: yct
  * @Date: 2020-07-19 09:57:45
- * @LastEditTime: 2020-09-11 11:41:09
+ * @LastEditTime: 2020-07-22 19:07:45
  * @LastEditors: yct
  */
 
@@ -117,7 +117,6 @@ Error_manager Parkspace_db_manager::get_all_parkspace_info(message::Parkspace_al
                         t_parkspace->set_parkspace_status(message::Parkspace_status::eParkspace_error);
                         break;
                     }
-                    t_parkspace->set_block_id(tp_result->getInt("parkingSpaceBlockID"));
                     t_parkspace->set_width(tp_result->getDouble("parkSpaceWidth"));
                     t_parkspace->set_height(tp_result->getDouble("parkSpaceHeight"));
                     t_parkspace->mutable_car_info()->set_license(tp_result->getString("parkSpaceCarLicense"));
@@ -148,10 +147,49 @@ Error_manager Parkspace_db_manager::get_all_parkspace_info(message::Parkspace_al
     }
 }
 
+// 清除数据库中所有车位号牌,状态全修改为空闲
+Error_manager Parkspace_db_manager::clean_all_parkspace_info()
+{
+    // 基本条件判断
+    if(!mb_initialized)
+    {
+        return DB_UNINITIALIZED;
+    }
+    if(mp_db_controller == nullptr)
+    {
+        return POINTER_IS_NULL;
+    }else{
+        //执行sql操作
+        char update_space_sql[1024];
+        memset(update_space_sql, 0, 1024);
+        sprintf(update_space_sql, "update parkingspace set parkingSpaceState = 0, parkSpaceCarLicense=''");
+        Error_manager ec = mp_db_controller->sql_update(update_space_sql);
+        return ec;
+    }
+    return ERROR;
+}
+
 // 更新数据库中所有车位信息
 Error_manager Parkspace_db_manager::update_all_parkspace_info(message::Parkspace_allocation_status_msg all_parkspace_info)
 {
-    return SUCCESS;
+    // 基本条件判断
+    if(!mb_initialized)
+    {
+        return DB_UNINITIALIZED;
+    }
+    if(mp_db_controller == nullptr)
+    {
+        return POINTER_IS_NULL;
+    }else if(all_parkspace_info.parkspace_info_size() >0){
+        Error_manager ec = SUCCESS;
+        for (size_t i = 0; i < all_parkspace_info.parkspace_info_size(); i++)
+        {
+            Error_manager t_ec = update_parkspace_status(all_parkspace_info.parkspace_info(i));
+            ec.compare_and_cover_error(&t_ec);
+        }
+        return ec;
+    }
+    return ERROR;
 }
 
 // 更新数据库中车位状态
@@ -206,7 +244,7 @@ Error_manager Parkspace_db_manager::update_parkspace_status(message::Parkspace_i
         }
         if(status < 0)
             return ERROR;
-        boost::shared_ptr<sql::ResultSet>  tp_result = nullptr;
+        //boost::shared_ptr<sql::ResultSet>  tp_result = nullptr;
         Error_manager ec = mp_db_controller->sql_update(update_space_sql);
         return ec;
     }

+ 2 - 0
parkspace_allocation/parkspace_db_manager.h

@@ -39,6 +39,8 @@ public:
     // ******** 数据库具体操作函数 *********
     // 从数据库获得所有车位信息,用于车位模块初始化
     Error_manager get_all_parkspace_info(message::Parkspace_allocation_status_msg &all_parkspace_info);
+    // 清除数据库中所有车位号牌,状态全修改为空闲
+    Error_manager clean_all_parkspace_info();
     // 更新数据库中所有车位信息
     Error_manager update_all_parkspace_info(message::Parkspace_allocation_status_msg all_parkspace_info);
     // 更新数据库中车位状态

+ 4 - 417
parkspace_allocation/parkspace_parameter.pb.cc

@@ -25,11 +25,6 @@ class database_configDefaultTypeInternal {
   ::google::protobuf::internal::ExplicitlyConstructed<database_config>
       _instance;
 } _database_config_default_instance_;
-class garage_configDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<garage_config>
-      _instance;
-} _garage_config_default_instance_;
 }  // namespace parkspace_proto
 namespace protobuf_parkspace_5fparameter_2eproto {
 void InitDefaultsdatabase_configImpl() {
@@ -53,29 +48,7 @@ void InitDefaultsdatabase_config() {
   ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsdatabase_configImpl);
 }
 
-void InitDefaultsgarage_configImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  protobuf_parkspace_5fparameter_2eproto::InitDefaultsdatabase_config();
-  {
-    void* ptr = &::parkspace_proto::_garage_config_default_instance_;
-    new (ptr) ::parkspace_proto::garage_config();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::parkspace_proto::garage_config::InitAsDefaultInstance();
-}
-
-void InitDefaultsgarage_config() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsgarage_configImpl);
-}
-
-::google::protobuf::Metadata file_level_metadata[2];
+::google::protobuf::Metadata file_level_metadata[1];
 
 const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::parkspace_proto::database_config, _has_bits_),
@@ -95,26 +68,13 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUT
   2,
   3,
   5,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::parkspace_proto::garage_config, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::parkspace_proto::garage_config, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::parkspace_proto::garage_config, block_size_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::parkspace_proto::garage_config, terminal_size_in_block_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::parkspace_proto::garage_config, db_config_),
-  1,
-  2,
-  0,
 };
 static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
   { 0, 11, sizeof(::parkspace_proto::database_config)},
-  { 17, 25, sizeof(::parkspace_proto::garage_config)},
 };
 
 static ::google::protobuf::Message const * const file_default_instances[] = {
   reinterpret_cast<const ::google::protobuf::Message*>(&::parkspace_proto::_database_config_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::parkspace_proto::_garage_config_default_instance_),
 };
 
 void protobuf_AssignDescriptors() {
@@ -133,7 +93,7 @@ void protobuf_AssignDescriptorsOnce() {
 void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
 void protobuf_RegisterTypes(const ::std::string&) {
   protobuf_AssignDescriptorsOnce();
-  ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 2);
+  ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1);
 }
 
 void AddDescriptorsImpl() {
@@ -143,13 +103,10 @@ void AddDescriptorsImpl() {
       "roto\"\207\001\n\017database_config\022\r\n\005db_ip\030\001 \002(\t\022"
       "\017\n\007db_port\030\002 \002(\003\022\023\n\013db_username\030\003 \002(\t\022\023\n"
       "\tdb_passwd\030\004 \001(\t:\000\022\017\n\007db_name\030\005 \002(\t\022\031\n\021d"
-      "b_conn_pool_size\030\006 \001(\003\"x\n\rgarage_config\022"
-      "\022\n\nblock_size\030\001 \002(\003\022\036\n\026terminal_size_in_"
-      "block\030\002 \002(\003\0223\n\tdb_config\030\003 \002(\0132 .parkspa"
-      "ce_proto.database_config"
+      "b_conn_pool_size\030\006 \001(\003"
   };
   ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
-      descriptor, 304);
+      descriptor, 182);
   ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
     "parkspace_parameter.proto", &protobuf_RegisterTypes);
 }
@@ -732,376 +689,6 @@ void database_config::InternalSwap(database_config* other) {
 }
 
 
-// ===================================================================
-
-void garage_config::InitAsDefaultInstance() {
-  ::parkspace_proto::_garage_config_default_instance_._instance.get_mutable()->db_config_ = const_cast< ::parkspace_proto::database_config*>(
-      ::parkspace_proto::database_config::internal_default_instance());
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int garage_config::kBlockSizeFieldNumber;
-const int garage_config::kTerminalSizeInBlockFieldNumber;
-const int garage_config::kDbConfigFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-garage_config::garage_config()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_parkspace_5fparameter_2eproto::InitDefaultsgarage_config();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:parkspace_proto.garage_config)
-}
-garage_config::garage_config(const garage_config& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  if (from.has_db_config()) {
-    db_config_ = new ::parkspace_proto::database_config(*from.db_config_);
-  } else {
-    db_config_ = NULL;
-  }
-  ::memcpy(&block_size_, &from.block_size_,
-    static_cast<size_t>(reinterpret_cast<char*>(&terminal_size_in_block_) -
-    reinterpret_cast<char*>(&block_size_)) + sizeof(terminal_size_in_block_));
-  // @@protoc_insertion_point(copy_constructor:parkspace_proto.garage_config)
-}
-
-void garage_config::SharedCtor() {
-  _cached_size_ = 0;
-  ::memset(&db_config_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&terminal_size_in_block_) -
-      reinterpret_cast<char*>(&db_config_)) + sizeof(terminal_size_in_block_));
-}
-
-garage_config::~garage_config() {
-  // @@protoc_insertion_point(destructor:parkspace_proto.garage_config)
-  SharedDtor();
-}
-
-void garage_config::SharedDtor() {
-  if (this != internal_default_instance()) delete db_config_;
-}
-
-void garage_config::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* garage_config::descriptor() {
-  ::protobuf_parkspace_5fparameter_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_parkspace_5fparameter_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const garage_config& garage_config::default_instance() {
-  ::protobuf_parkspace_5fparameter_2eproto::InitDefaultsgarage_config();
-  return *internal_default_instance();
-}
-
-garage_config* garage_config::New(::google::protobuf::Arena* arena) const {
-  garage_config* n = new garage_config;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
-}
-
-void garage_config::Clear() {
-// @@protoc_insertion_point(message_clear_start:parkspace_proto.garage_config)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  // Prevent compiler warnings about cached_has_bits being unused
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 0x00000001u) {
-    GOOGLE_DCHECK(db_config_ != NULL);
-    db_config_->Clear();
-  }
-  if (cached_has_bits & 6u) {
-    ::memset(&block_size_, 0, static_cast<size_t>(
-        reinterpret_cast<char*>(&terminal_size_in_block_) -
-        reinterpret_cast<char*>(&block_size_)) + sizeof(terminal_size_in_block_));
-  }
-  _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool garage_config::MergePartialFromCodedStream(
-    ::google::protobuf::io::CodedInputStream* input) {
-#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
-  ::google::protobuf::uint32 tag;
-  // @@protoc_insertion_point(parse_start:parkspace_proto.garage_config)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
-      // required int64 block_size = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          set_has_block_size();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
-                 input, &block_size_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // required int64 terminal_size_in_block = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          set_has_terminal_size_in_block();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
-                 input, &terminal_size_in_block_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // required .parkspace_proto.database_config db_config = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_db_config()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      default: {
-      handle_unusual:
-        if (tag == 0) {
-          goto success;
-        }
-        DO_(::google::protobuf::internal::WireFormat::SkipField(
-              input, tag, _internal_metadata_.mutable_unknown_fields()));
-        break;
-      }
-    }
-  }
-success:
-  // @@protoc_insertion_point(parse_success:parkspace_proto.garage_config)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:parkspace_proto.garage_config)
-  return false;
-#undef DO_
-}
-
-void garage_config::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:parkspace_proto.garage_config)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // required int64 block_size = 1;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->block_size(), output);
-  }
-
-  // required int64 terminal_size_in_block = 2;
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->terminal_size_in_block(), output);
-  }
-
-  // required .parkspace_proto.database_config db_config = 3;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      3, *this->db_config_, output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:parkspace_proto.garage_config)
-}
-
-::google::protobuf::uint8* garage_config::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:parkspace_proto.garage_config)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // required int64 block_size = 1;
-  if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->block_size(), target);
-  }
-
-  // required int64 terminal_size_in_block = 2;
-  if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->terminal_size_in_block(), target);
-  }
-
-  // required .parkspace_proto.database_config db_config = 3;
-  if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        3, *this->db_config_, deterministic, target);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
-  }
-  // @@protoc_insertion_point(serialize_to_array_end:parkspace_proto.garage_config)
-  return target;
-}
-
-size_t garage_config::RequiredFieldsByteSizeFallback() const {
-// @@protoc_insertion_point(required_fields_byte_size_fallback_start:parkspace_proto.garage_config)
-  size_t total_size = 0;
-
-  if (has_db_config()) {
-    // required .parkspace_proto.database_config db_config = 3;
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::MessageSize(
-        *this->db_config_);
-  }
-
-  if (has_block_size()) {
-    // required int64 block_size = 1;
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::Int64Size(
-        this->block_size());
-  }
-
-  if (has_terminal_size_in_block()) {
-    // required int64 terminal_size_in_block = 2;
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::Int64Size(
-        this->terminal_size_in_block());
-  }
-
-  return total_size;
-}
-size_t garage_config::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:parkspace_proto.garage_config)
-  size_t total_size = 0;
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
-  if (((_has_bits_[0] & 0x00000007) ^ 0x00000007) == 0) {  // All required fields are present.
-    // required .parkspace_proto.database_config db_config = 3;
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::MessageSize(
-        *this->db_config_);
-
-    // required int64 block_size = 1;
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::Int64Size(
-        this->block_size());
-
-    // required int64 terminal_size_in_block = 2;
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::Int64Size(
-        this->terminal_size_in_block());
-
-  } else {
-    total_size += RequiredFieldsByteSizeFallback();
-  }
-  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = cached_size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-  return total_size;
-}
-
-void garage_config::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:parkspace_proto.garage_config)
-  GOOGLE_DCHECK_NE(&from, this);
-  const garage_config* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const garage_config>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:parkspace_proto.garage_config)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:parkspace_proto.garage_config)
-    MergeFrom(*source);
-  }
-}
-
-void garage_config::MergeFrom(const garage_config& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:parkspace_proto.garage_config)
-  GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 7u) {
-    if (cached_has_bits & 0x00000001u) {
-      mutable_db_config()->::parkspace_proto::database_config::MergeFrom(from.db_config());
-    }
-    if (cached_has_bits & 0x00000002u) {
-      block_size_ = from.block_size_;
-    }
-    if (cached_has_bits & 0x00000004u) {
-      terminal_size_in_block_ = from.terminal_size_in_block_;
-    }
-    _has_bits_[0] |= cached_has_bits;
-  }
-}
-
-void garage_config::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:parkspace_proto.garage_config)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-void garage_config::CopyFrom(const garage_config& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:parkspace_proto.garage_config)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-bool garage_config::IsInitialized() const {
-  if ((_has_bits_[0] & 0x00000007) != 0x00000007) return false;
-  if (has_db_config()) {
-    if (!this->db_config_->IsInitialized()) return false;
-  }
-  return true;
-}
-
-void garage_config::Swap(garage_config* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
-void garage_config::InternalSwap(garage_config* other) {
-  using std::swap;
-  swap(db_config_, other->db_config_);
-  swap(block_size_, other->block_size_);
-  swap(terminal_size_in_block_, other->terminal_size_in_block_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-}
-
-::google::protobuf::Metadata garage_config::GetMetadata() const {
-  protobuf_parkspace_5fparameter_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_parkspace_5fparameter_2eproto::file_level_metadata[kIndexInFileMessages];
-}
-
-
 // @@protoc_insertion_point(namespace_scope)
 }  // namespace parkspace_proto
 

+ 1 - 250
parkspace_allocation/parkspace_parameter.pb.h

@@ -36,7 +36,7 @@ namespace protobuf_parkspace_5fparameter_2eproto {
 struct TableStruct {
   static const ::google::protobuf::internal::ParseTableField entries[];
   static const ::google::protobuf::internal::AuxillaryParseTableField aux[];
-  static const ::google::protobuf::internal::ParseTable schema[2];
+  static const ::google::protobuf::internal::ParseTable schema[1];
   static const ::google::protobuf::internal::FieldMetadata field_metadata[];
   static const ::google::protobuf::internal::SerializationTable serialization_table[];
   static const ::google::protobuf::uint32 offsets[];
@@ -44,20 +44,14 @@ struct TableStruct {
 void AddDescriptors();
 void InitDefaultsdatabase_configImpl();
 void InitDefaultsdatabase_config();
-void InitDefaultsgarage_configImpl();
-void InitDefaultsgarage_config();
 inline void InitDefaults() {
   InitDefaultsdatabase_config();
-  InitDefaultsgarage_config();
 }
 }  // namespace protobuf_parkspace_5fparameter_2eproto
 namespace parkspace_proto {
 class database_config;
 class database_configDefaultTypeInternal;
 extern database_configDefaultTypeInternal _database_config_default_instance_;
-class garage_config;
-class garage_configDefaultTypeInternal;
-extern garage_configDefaultTypeInternal _garage_config_default_instance_;
 }  // namespace parkspace_proto
 namespace parkspace_proto {
 
@@ -256,141 +250,6 @@ class database_config : public ::google::protobuf::Message /* @@protoc_insertion
   friend struct ::protobuf_parkspace_5fparameter_2eproto::TableStruct;
   friend void ::protobuf_parkspace_5fparameter_2eproto::InitDefaultsdatabase_configImpl();
 };
-// -------------------------------------------------------------------
-
-class garage_config : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:parkspace_proto.garage_config) */ {
- public:
-  garage_config();
-  virtual ~garage_config();
-
-  garage_config(const garage_config& from);
-
-  inline garage_config& operator=(const garage_config& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
-  garage_config(garage_config&& from) noexcept
-    : garage_config() {
-    *this = ::std::move(from);
-  }
-
-  inline garage_config& operator=(garage_config&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
-    } else {
-      CopyFrom(from);
-    }
-    return *this;
-  }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
-  }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
-  }
-
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const garage_config& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
-  static inline const garage_config* internal_default_instance() {
-    return reinterpret_cast<const garage_config*>(
-               &_garage_config_default_instance_);
-  }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
-    1;
-
-  void Swap(garage_config* other);
-  friend void swap(garage_config& a, garage_config& b) {
-    a.Swap(&b);
-  }
-
-  // implements Message ----------------------------------------------
-
-  inline garage_config* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  garage_config* New(::google::protobuf::Arena* arena) const PROTOBUF_FINAL;
-  void CopyFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL;
-  void MergeFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL;
-  void CopyFrom(const garage_config& from);
-  void MergeFrom(const garage_config& from);
-  void Clear() PROTOBUF_FINAL;
-  bool IsInitialized() const PROTOBUF_FINAL;
-
-  size_t ByteSizeLong() const PROTOBUF_FINAL;
-  bool MergePartialFromCodedStream(
-      ::google::protobuf::io::CodedInputStream* input) PROTOBUF_FINAL;
-  void SerializeWithCachedSizes(
-      ::google::protobuf::io::CodedOutputStream* output) const PROTOBUF_FINAL;
-  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(
-      bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL;
-  int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; }
-  private:
-  void SharedCtor();
-  void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
-  void InternalSwap(garage_config* other);
-  private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
-  }
-  public:
-
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
-
-  // nested types ----------------------------------------------------
-
-  // accessors -------------------------------------------------------
-
-  // required .parkspace_proto.database_config db_config = 3;
-  bool has_db_config() const;
-  void clear_db_config();
-  static const int kDbConfigFieldNumber = 3;
-  const ::parkspace_proto::database_config& db_config() const;
-  ::parkspace_proto::database_config* release_db_config();
-  ::parkspace_proto::database_config* mutable_db_config();
-  void set_allocated_db_config(::parkspace_proto::database_config* db_config);
-
-  // required int64 block_size = 1;
-  bool has_block_size() const;
-  void clear_block_size();
-  static const int kBlockSizeFieldNumber = 1;
-  ::google::protobuf::int64 block_size() const;
-  void set_block_size(::google::protobuf::int64 value);
-
-  // required int64 terminal_size_in_block = 2;
-  bool has_terminal_size_in_block() const;
-  void clear_terminal_size_in_block();
-  static const int kTerminalSizeInBlockFieldNumber = 2;
-  ::google::protobuf::int64 terminal_size_in_block() const;
-  void set_terminal_size_in_block(::google::protobuf::int64 value);
-
-  // @@protoc_insertion_point(class_scope:parkspace_proto.garage_config)
- private:
-  void set_has_block_size();
-  void clear_has_block_size();
-  void set_has_terminal_size_in_block();
-  void clear_has_terminal_size_in_block();
-  void set_has_db_config();
-  void clear_has_db_config();
-
-  // helper for ByteSizeLong()
-  size_t RequiredFieldsByteSizeFallback() const;
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::parkspace_proto::database_config* db_config_;
-  ::google::protobuf::int64 block_size_;
-  ::google::protobuf::int64 terminal_size_in_block_;
-  friend struct ::protobuf_parkspace_5fparameter_2eproto::TableStruct;
-  friend void ::protobuf_parkspace_5fparameter_2eproto::InitDefaultsgarage_configImpl();
-};
 // ===================================================================
 
 
@@ -702,117 +561,9 @@ inline void database_config::set_db_conn_pool_size(::google::protobuf::int64 val
   // @@protoc_insertion_point(field_set:parkspace_proto.database_config.db_conn_pool_size)
 }
 
-// -------------------------------------------------------------------
-
-// garage_config
-
-// required int64 block_size = 1;
-inline bool garage_config::has_block_size() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void garage_config::set_has_block_size() {
-  _has_bits_[0] |= 0x00000002u;
-}
-inline void garage_config::clear_has_block_size() {
-  _has_bits_[0] &= ~0x00000002u;
-}
-inline void garage_config::clear_block_size() {
-  block_size_ = GOOGLE_LONGLONG(0);
-  clear_has_block_size();
-}
-inline ::google::protobuf::int64 garage_config::block_size() const {
-  // @@protoc_insertion_point(field_get:parkspace_proto.garage_config.block_size)
-  return block_size_;
-}
-inline void garage_config::set_block_size(::google::protobuf::int64 value) {
-  set_has_block_size();
-  block_size_ = value;
-  // @@protoc_insertion_point(field_set:parkspace_proto.garage_config.block_size)
-}
-
-// required int64 terminal_size_in_block = 2;
-inline bool garage_config::has_terminal_size_in_block() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
-}
-inline void garage_config::set_has_terminal_size_in_block() {
-  _has_bits_[0] |= 0x00000004u;
-}
-inline void garage_config::clear_has_terminal_size_in_block() {
-  _has_bits_[0] &= ~0x00000004u;
-}
-inline void garage_config::clear_terminal_size_in_block() {
-  terminal_size_in_block_ = GOOGLE_LONGLONG(0);
-  clear_has_terminal_size_in_block();
-}
-inline ::google::protobuf::int64 garage_config::terminal_size_in_block() const {
-  // @@protoc_insertion_point(field_get:parkspace_proto.garage_config.terminal_size_in_block)
-  return terminal_size_in_block_;
-}
-inline void garage_config::set_terminal_size_in_block(::google::protobuf::int64 value) {
-  set_has_terminal_size_in_block();
-  terminal_size_in_block_ = value;
-  // @@protoc_insertion_point(field_set:parkspace_proto.garage_config.terminal_size_in_block)
-}
-
-// required .parkspace_proto.database_config db_config = 3;
-inline bool garage_config::has_db_config() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void garage_config::set_has_db_config() {
-  _has_bits_[0] |= 0x00000001u;
-}
-inline void garage_config::clear_has_db_config() {
-  _has_bits_[0] &= ~0x00000001u;
-}
-inline void garage_config::clear_db_config() {
-  if (db_config_ != NULL) db_config_->Clear();
-  clear_has_db_config();
-}
-inline const ::parkspace_proto::database_config& garage_config::db_config() const {
-  const ::parkspace_proto::database_config* p = db_config_;
-  // @@protoc_insertion_point(field_get:parkspace_proto.garage_config.db_config)
-  return p != NULL ? *p : *reinterpret_cast<const ::parkspace_proto::database_config*>(
-      &::parkspace_proto::_database_config_default_instance_);
-}
-inline ::parkspace_proto::database_config* garage_config::release_db_config() {
-  // @@protoc_insertion_point(field_release:parkspace_proto.garage_config.db_config)
-  clear_has_db_config();
-  ::parkspace_proto::database_config* temp = db_config_;
-  db_config_ = NULL;
-  return temp;
-}
-inline ::parkspace_proto::database_config* garage_config::mutable_db_config() {
-  set_has_db_config();
-  if (db_config_ == NULL) {
-    db_config_ = new ::parkspace_proto::database_config;
-  }
-  // @@protoc_insertion_point(field_mutable:parkspace_proto.garage_config.db_config)
-  return db_config_;
-}
-inline void garage_config::set_allocated_db_config(::parkspace_proto::database_config* db_config) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
-    delete db_config_;
-  }
-  if (db_config) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
-    if (message_arena != submessage_arena) {
-      db_config = ::google::protobuf::internal::GetOwnedMessage(
-          message_arena, db_config, submessage_arena);
-    }
-    set_has_db_config();
-  } else {
-    clear_has_db_config();
-  }
-  db_config_ = db_config;
-  // @@protoc_insertion_point(field_set_allocated:parkspace_proto.garage_config.db_config)
-}
-
 #ifdef __GNUC__
   #pragma GCC diagnostic pop
 #endif  // __GNUC__
-// -------------------------------------------------------------------
-
 
 // @@protoc_insertion_point(namespace_scope)
 

+ 0 - 7
parkspace_allocation/parkspace_parameter.proto

@@ -10,10 +10,3 @@ message database_config
     required string db_name=5;
     optional int64 db_conn_pool_size=6;
 }
-
-message garage_config
-{
-    required int64 block_size=1;//每层独立区域块个数
-    required int64 terminal_size_in_block=2;//每个区域块包含终端数
-    required database_config db_config=3;
-}

+ 5 - 3
proto.sh

@@ -1,6 +1,8 @@
 protoc -I=./message message_base.proto --cpp_out=./message
-protoc -I=./message measure_message.proto --cpp_out=./message
-protoc -I=./message hardware_message.proto --cpp_out=./message
+#protoc -I=./message measure_message.proto --cpp_out=./message
+#protoc -I=./message hardware_message.proto --cpp_out=./message
 protoc -I=./message parkspace_allocation_message.proto --cpp_out=./message
 #protoc -I=./ setting.proto --cpp_out=./
-protoc -I=./parkspace_allocation parkspace_parameter.proto --cpp_out=./parkspace_allocation
+protoc -I=./parkspace_allocation parkspace_parameter.proto --cpp_out=./parkspace_allocation
+
+protoc -I=./communication communication.proto --cpp_out=./communication

+ 0 - 12
setting/parkspace_config.prototxt

@@ -1,12 +0,0 @@
-
-block_size:3,
-terminal_size_in_block:2,
-db_config
-{
-    db_ip:"127.0.0.1",
-    db_port:3306,
-    db_username:"yct",
-    db_passwd:"123456",
-    db_name:"test",
-    db_conn_pool_size:5
-}

+ 31 - 49
test/parkspace_client.cpp

@@ -2,7 +2,7 @@
  * @Description: 模拟主程序发送车位分配请求,并监听状态信息
  * @Author: yct
  * @Date: 2020-07-08 15:44:43
- * @LastEditTime: 2020-09-11 14:25:50
+ * @LastEditTime: 2020-07-22 18:15:55
  * @LastEditors: yct
  */
 
@@ -29,15 +29,11 @@ std::string send_allocation_request(int n)
     base_info.set_timeout_ms(2000);
     car_info.set_car_height(1.0);
     car_info.set_car_width(1.0);
-    car_info.set_license((std::string("鄂A1234")+std::to_string(n)).c_str());
+    car_info.set_license("鄂A12345");
 
     request.mutable_base_info()->CopyFrom(base_info);
-    message::Command_info cmd_info;
-    cmd_info.set_time("12345");
-    cmd_info.set_location("aaaaaa");
-    cmd_info.set_event(message::Event::ePicking);
-    request.mutable_command_info()->CopyFrom(cmd_info);
-    request.set_terminal_id(n);
+    request.set_command_id(n);
+    request.set_terminal_id(1);
     request.mutable_car_info()->CopyFrom(car_info);
 
     // socket.send(request.SerializeAsString());
@@ -61,11 +57,7 @@ std::string send_search_requests(int n, std::string license="鄂A12345")
     car_info.set_license(license);
 
     request.mutable_base_info()->CopyFrom(base_info);
-    message::Command_info cmd_info;
-    cmd_info.set_time("12345");
-    cmd_info.set_location("aaaaaa");
-    cmd_info.set_event(message::Event::ePicking);
-    request.mutable_command_info()->CopyFrom(cmd_info);
+    request.set_command_id(n);
     request.mutable_car_info()->CopyFrom(car_info);
 
     // socket.send(request.SerializeAsString());
@@ -98,11 +90,7 @@ std::string send_release_request(int n)
     space_info.mutable_car_info()->CopyFrom(car_info);
 
     request.mutable_base_info()->CopyFrom(base_info);
-    message::Command_info cmd_info;
-    cmd_info.set_time("12345");
-    cmd_info.set_location("aaaaaa");
-    cmd_info.set_event(message::Event::ePicking);
-    request.mutable_command_info()->CopyFrom(cmd_info);
+    request.set_command_id(n);
     request.mutable_release_space_info()->CopyFrom(space_info);
 
     // socket.send(request.SerializeAsString());
@@ -135,11 +123,7 @@ std::string send_confirm_request(int n)
     space_info.mutable_car_info()->CopyFrom(car_info);
 
     request.mutable_base_info()->CopyFrom(base_info);
-    message::Command_info cmd_info;
-    cmd_info.set_time("12345");
-    cmd_info.set_location("aaaaaa");
-    cmd_info.set_event(message::Event::ePicking);
-    request.mutable_command_info()->CopyFrom(cmd_info);
+    request.set_command_id(n);
     request.mutable_confirm_space_info()->CopyFrom(space_info);
 
     // socket.send(request.SerializeAsString());
@@ -156,31 +140,29 @@ int main()
 
     usleep(1000 * 3000);
 
-    std::string alloc_req = send_allocation_request(0);
-    socket.send(alloc_req);
-    // usleep(1000 * 500);
-    alloc_req = send_allocation_request(1);
-    socket.send(alloc_req);
-    alloc_req = send_allocation_request(2);
-    socket.send(alloc_req);
-    alloc_req = send_allocation_request(3);
-    socket.send(alloc_req);
-    alloc_req = send_allocation_request(4);
+    std::string alloc_req = send_allocation_request(1);
     socket.send(alloc_req);
-    alloc_req = send_allocation_request(5);
-    socket.send(alloc_req);
-
-    // std::string confirm_req = send_confirm_request(1);
-    // socket.send(confirm_req);
-    // usleep(1000 * 500);
+    usleep(1000 * 500);
+    // alloc_req = send_allocation_request(2);
+    // socket.send(alloc_req);
+    // alloc_req = send_allocation_request(3);
+    // socket.send(alloc_req);
+    // alloc_req = send_allocation_request(4);
+    // socket.send(alloc_req);
+    // alloc_req = send_allocation_request(5);
+    // socket.send(alloc_req);
+
+    std::string confirm_req = send_confirm_request(1);
+    socket.send(confirm_req);
+    usleep(1000 * 500);
     
-    // std::string search_req = send_search_requests(1);
-    // socket.send(search_req);
-    // usleep(1000 * 500);
+    std::string search_req = send_search_requests(1);
+    socket.send(search_req);
+    usleep(1000 * 500);
 
-    // std::string release_req = send_release_request(1);
-    // socket.send(release_req);
-    // usleep(1000 * 500);
+    std::string release_req = send_release_request(1);
+    socket.send(release_req);
+    usleep(1000 * 500);
 
     // usleep(1000*200);
     // search_req = send_search_requests(3);
@@ -215,10 +197,10 @@ int main()
                 std::cout << "cycle " << n << std::endl;
                 if (base_msg.base_info().msg_type() == message::Message_type::eParkspace_allocation_status_msg)
                 {
-                    // message::Parkspace_allocation_status_msg parkspace_status;
-                    // std::cout << "----------------- 车位状态 -----------------" << std::endl;
-                    // parkspace_status.ParseFromString(t_receive_string);
-                    // std::cout << parkspace_status.DebugString() << std::endl;
+                    message::Parkspace_allocation_status_msg parkspace_status;
+                    std::cout << "----------------- 车位状态 -----------------" << std::endl;
+                    parkspace_status.ParseFromString(t_receive_string);
+                    std::cout << parkspace_status.DebugString() << std::endl;
                     // continue;
                 }
                 else if (base_msg.base_info().msg_type() == message::Message_type::eParkspace_allocation_response_msg)

+ 12 - 16
test/test_parkspace_sample.cpp

@@ -2,37 +2,33 @@
  * @Description: 测试车位分配模块通信情况
  * @Author: yct
  * @Date: 2020-07-08 15:51:46
- * @LastEditTime: 2020-09-18 11:21:22
+ * @LastEditTime: 2020-07-24 10:54:17
  * @LastEditors: yct
  */ 
 #include "../parkspace_allocation/parkspace_allocation_communicator.h"
 #include "../parkspace_allocation/parkspace_allocator.h"
-#include "../tool/proto_tool.h"
 
 int main()
 {
     google::InitGoogleLogging("parkspace_allocator");
     google::SetStderrLogging(google::INFO);
     google::InstallFailureSignalHandler();
-    FLAGS_colorlogtostderr = true;
-
-    parkspace_proto::garage_config config;
-    // // parkspace_proto::database_config config;
-    // config.mutable_db_config()->set_db_ip("127.0.0.1");
-    // config.mutable_db_config()->set_db_port(3306);
-    // config.mutable_db_config()->set_db_username("yct");
-    // config.mutable_db_config()->set_db_passwd("123456");
-    // config.mutable_db_config()->set_db_name("test");
-    // config.mutable_db_config()->set_db_conn_pool_size(5);
-    // config.set_block_size(3);
-    // config.set_terminal_size_in_block(2);
-    proto_tool::get_instance_references().read_proto_param("../setting/parkspace_config.prototxt", config);
+    FLAGS_colorlogtostderr = true; 
 
     Parkspace_allocation_communicator *p_parkspace_allocation_communicater = Parkspace_allocation_communicator::get_instance_pointer();
     Parkspace_allocator *p_parkspace_allocator = Parkspace_allocator::get_instance_pointer();
 
+
+    parkspace_proto::database_config config;
+    config.set_db_ip("127.0.0.1");
+    config.set_db_port(3306);
+    config.set_db_username("wk");
+    config.set_db_passwd("123456");
+    config.set_db_name("test");
+    config.set_db_conn_pool_size(5);
     p_parkspace_allocator->parkspace_allocator_init(4, config);
-    p_parkspace_allocation_communicater->communication_bind("tcp://127.0.0.1:7001");
+    p_parkspace_allocation_communicater->communication_connect("tcp://192.168.2.183:30000");
+    p_parkspace_allocation_communicater->communication_bind("tcp://192.168.2.113:30005");
     // p_parkspace_allocation_communicater->communication_bind("tcp://192.168.2.125:7001");
     // p_parkspace_allocation_communicater->communication_connect("tcp://127.0.0.1:7000");
     p_parkspace_allocation_communicater->communication_run();

+ 0 - 0
tool/binary_buf.cpp


+ 0 - 0
tool/binary_buf.h


+ 0 - 0
tool/binary_buf.puml


+ 0 - 0
tool/thread_condition.cpp


+ 1 - 1
tool/thread_condition.h

@@ -36,7 +36,7 @@
 #include <atomic>
 #include <mutex>
 #include <condition_variable>
-
+#include <functional>
 
 class Thread_condition
 {

+ 0 - 0
tool/thread_condition.puml


+ 0 - 0
tool/thread_safe_queue.cpp


+ 0 - 0
tool/thread_safe_queue.h


+ 0 - 0
tool/thread_safe_queue.puml