Parcourir la source

20200902, 目前已经完成了通信

huli il y a 4 ans
Parent
commit
5126b3e29d

+ 15 - 6
dispatch/dispatch_manager.cpp

@@ -19,9 +19,10 @@ Dispatch_manager::~Dispatch_manager()
 
 
 //调度管理 初始化
-Error_manager Dispatch_manager::dispatch_manager_init()
+Error_manager Dispatch_manager::dispatch_manager_init(int dispatch_id)
 {
 	m_dispatch_manager_status = E_DISPATCH_MANAGER_READY;
+	m_dispatch_id = dispatch_id;
 //	m_carrier_number = size;
 //
 //	for (int i = 0; i < size; ++i)
@@ -43,6 +44,7 @@ Error_manager Dispatch_manager::dispatch_manager_uninit()
 //	}
 
 	m_dispatch_manager_status = E_DISPATCH_MANAGER_UNKNOW;
+
 //	m_carrier_number = 0;
 //	m_carrier_vector.clear();
 	return Error_code::SUCCESS;
@@ -51,20 +53,20 @@ Error_manager Dispatch_manager::dispatch_manager_uninit()
 //对外的接口函数,负责接受并处理任务单,
 Error_manager Dispatch_manager::execute_task(Dispatch_manager::Dispatch_motion_direction dispatch_motion_direction)
 {
-
+return Error_code::SUCCESS;
 //	std::this_thread::sleep_for(std::chrono::seconds(rand()%3+3));
 
-	if ( dispatch_motion_direction == E_STORE_CAR )
+	if ( dispatch_motion_direction == E_PICKUP_CAR )
 	{
 		return Error_code::SUCCESS;
 	}
 
-	return Error_code::SUCCESS;
+//	return Error_code::SUCCESS;
 
 //	srand(0);
 	unsigned int t_probability = rand();
 
-	if ( t_probability%100 >=40 )
+	if ( t_probability%100 >=20 )
 	{
 	    return Error_code::SUCCESS;
 	}
@@ -100,5 +102,12 @@ Dispatch_manager::Dispatch_manager_status Dispatch_manager::get_dispatch_manager
 	return m_dispatch_manager_status;
 }
 
-
+int Dispatch_manager::get_dispatch_id()
+{
+	return m_dispatch_id;
+}
+void Dispatch_manager::set_dispatch_id(int dispatch_id)
+{
+	m_dispatch_id = dispatch_id;
+}
 

+ 4 - 2
dispatch/dispatch_manager.h

@@ -66,7 +66,7 @@ public:
     ~Dispatch_manager();
 public://API functions
 	//调度管理 初始化
-	Error_manager dispatch_manager_init();
+	Error_manager dispatch_manager_init(int dispatch_id);
 	//调度管理 反初始化
 	Error_manager dispatch_manager_uninit();
 
@@ -77,11 +77,13 @@ public://API functions
 	Error_manager check_status();
 public://get or set member variable
 	Dispatch_manager_status get_dispatch_manager_status();
-
+	int get_dispatch_id();
+	void set_dispatch_id(int dispatch_id);
 protected://member variable
 
 	Dispatch_manager_status						m_dispatch_manager_status;			//调度管理 的状态
 
+	int 										m_dispatch_id;						//
 
 //	int 										m_carrier_number;					//搬运器的数量, 默认3个
 //	std::vector<Carrier_base*>					m_carrier_vector;					//搬运器的对象实例,内存由本类管理

+ 12 - 1
main.cpp

@@ -61,7 +61,18 @@ int main(int argc,char* argv[])
 	FLAGS_max_log_size = 1024;            // Set max log file size(GB)
 	FLAGS_stop_logging_if_full_disk = true;
 
-	Dispatch_manager::get_instance_references().dispatch_manager_init();
+
+
+	int t_dispatch_id = 0;
+//	std::cin >> t_dispatch_id ;
+	if ( argc == 2 )
+	{
+		std::cout << " huli test :::: " << " argv[1] = " << argv[1] << std::endl;
+		t_dispatch_id = atoi(argv[1]);
+	}
+	std::cout << " huli test :::: " << " t_dispatch_id = " << t_dispatch_id << std::endl;
+
+	Dispatch_manager::get_instance_references().dispatch_manager_init(t_dispatch_id);
 	std::cout << "Dispatch_manager = " << Dispatch_manager::get_instance_references().get_dispatch_manager_status() << std::endl;
 
 	System_executor::get_instance_references().system_executor_init(8);

Fichier diff supprimé car celui-ci est trop grand
+ 1188 - 333
message/dispatch_message.pb.cc


Fichier diff supprimé car celui-ci est trop grand
+ 873 - 215
message/dispatch_message.pb.h


+ 7 - 7
message/dispatch_message.proto

@@ -91,17 +91,17 @@ enum Dispatch_motion_direction
     E_PICKUP_CAR            =1;         //取车, 停车位 -> 出入口
 }
 
-//调度管理各个零部件状态
+//调度管理总管理的状态
 message Dispatch_manager_status_msg
 {
     required Base_info                  base_info=1;                    //消息类型
     required int32                      dispatch_id=2;                  //调度管理模块 id
     required Dispatch_manager_status    dispatch_manager_status = 3;    //调度管理模块 状态
 
-    repeated Catcher_status             Catcher_status = 4;             //抓车器状态, 楚天项目就是AGV系统
-    repeated Carrier_status             Carrier_status = 5;             //搬运器状态, 楚天项目就是中跑车
-    repeated Elevator_status            Elevator_status = 6;            //升降机状态, 楚天项目就是电梯
-    repeated Passageway_status          Passageway_status = 7;          //通道口状态, 楚天项目就是一楼的出入口
+    repeated Catcher_status             catcher_status = 4;             //抓车器状态, 楚天项目就是AGV系统
+    repeated Carrier_status             carrier_status = 5;             //搬运器状态, 楚天项目就是中跑车
+    repeated Elevator_status            elevator_status = 6;            //升降机状态, 楚天项目就是电梯
+    repeated Passageway_status          passageway_status = 7;          //通道口状态, 楚天项目就是一楼的出入口
 }
 
 //调度模块终端出入口的状态
@@ -118,7 +118,7 @@ message Dispatch_terminal_status_msg
 message Dispatch_request_msg
 {
     required Base_info                  base_info=1;                            //消息类型
-    required Command_info               command_info=2;                           //指令唯一标识符id
+    required string                     command_key=2;                   //指令唯一标识符id
 
     required Dispatch_motion_direction  dispatch_motion_direction=3;            //调度方向, 停车取车
     required int32                      terminal_id=4;                          //终端id, 出入口
@@ -130,6 +130,6 @@ message Dispatch_request_msg
 message Dispatch_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;
 }

Fichier diff supprimé car celui-ci est trop grand
+ 1874 - 197
message/measure_message.pb.cc


Fichier diff supprimé car celui-ci est trop grand
+ 1422 - 317
message/measure_message.pb.h


+ 37 - 8
message/measure_message.proto

@@ -37,13 +37,13 @@ enum Locate_manager_status
 message Measure_status_msg
 {
     required Base_info                  base_info=1;                 //消息类型
+    required int32                      terminal_id=2;
+    required Laser_manager_status       laser_manager_status = 3;
+    repeated Laser_statu                laser_statu_vector = 4;
+    required Locate_manager_status      locate_manager_status = 5;
 
-    required Laser_manager_status       laser_manager_status = 2;
-    repeated Laser_statu                laser_statu_vector = 3;
-    required Locate_manager_status      locate_manager_status = 4;
-
-    optional Locate_information         locate_information_realtime=5;  //地面雷达的 实时定位信息
-    required Error_manager              error_manager = 6;
+    optional Locate_information         locate_information_realtime=6;  //地面雷达的 实时定位信息
+    required Error_manager              error_manager = 7;
 }
 
 
@@ -51,7 +51,7 @@ message Measure_status_msg
 message Measure_request_msg
 {
     required Base_info                  base_info=1;        //消息类型
-    required Command_info               command_info=2;                   //指令唯一标识符id
+    required string                     command_key=2;                   //指令唯一标识符id
     required int32                      terminal_id=3;          //终端id
 }
 
@@ -59,11 +59,40 @@ message Measure_request_msg
 message Measure_response_msg
 {
     required Base_info                  base_info=1;                         //消息类型
-    required Command_info               command_info=2;                   //指令唯一标识符id
+    required string                     command_key=2;                   //指令唯一标识符id
     required int32                      terminal_id=3;
 
     optional Locate_information         locate_information=4;
     required Error_manager              error_manager = 5;
 }
 
+//点云坐标
+message Cloud_coordinate
+{
+    required float                      x=1;
+    required float                      y=2;
+    required float                      z=3;
+}
+//点云类型
+message Cloud_type
+{
+    required int32                      type=1;
+}
 
+//筛选点云, 请求消息
+message Locate_sift_request_msg
+{
+    required Base_info                  base_info=1;            //消息类型
+    required string                     command_key=2;          //指令唯一标识符id
+    required int32                      terminal_id=3;          //终端id
+    repeated Cloud_coordinate           cloud_coordinates=4;     //点云坐标
+}
+
+//筛选点云, 请求消息
+message Locate_sift_response_msg
+{
+    required Base_info                  base_info=1;            //消息类型
+    required string                     command_key=2;          //指令唯一标识符id
+    required int32                      terminal_id=3;          //终端id
+    repeated Cloud_type                 cloud_type=4;            //点云类型
+}

+ 117 - 499
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, place_),
-  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_
@@ -318,17 +281,15 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUT
 };
 static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
   { 0, 9, sizeof(::message::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, 94, 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_),
@@ -352,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() {
@@ -362,62 +323,73 @@ 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\"J\n\014Command_info"
-      "\022\014\n\004time\030\001 \002(\t\022\r\n\005place\030\002 \002(\t\022\035\n\005event\030\003"
-      " \002(\0162\016.message.Event\"1\n\010Base_msg\022%\n\tbase"
-      "_info\030\001 \002(\0132\022.message.Base_info\"i\n\rError"
-      "_manager\022\022\n\nerror_code\030\001 \002(\005\022)\n\013error_le"
-      "vel\030\002 \001(\0162\024.message.Error_level\022\031\n\021error"
-      "_description\030\003 \001(\t\"\341\001\n\022Locate_informatio"
-      "n\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_heigh"
-      "t\030\006 \001(\002\022\031\n\021locate_wheel_base\030\007 \001(\002\022\032\n\022lo"
-      "cate_wheel_width\030\010 \001(\002\022\026\n\016locate_correct"
-      "\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\014par"
-      "kspace_id\030\001 \001(\005\022\r\n\005index\030\002 \001(\005\022%\n\tdirect"
-      "ion\030\003 \001(\0162\022.message.Direction\022\r\n\005floor\030\004"
-      " \001(\005\022\016\n\006length\030\005 \001(\002\022\r\n\005width\030\006 \001(\002\022\016\n\006h"
-      "eight\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*\276\006\n\014Message_type\022\r"
-      "\n\teBase_msg\020\000\022\020\n\014eCommand_msg\020\001\022\026\n\022eLoca"
-      "te_status_msg\020\021\022\027\n\023eLocate_request_msg\020\022"
-      "\022\030\n\024eLocate_response_msg\020\023\022\030\n\024eDispatch_"
-      "status_msg\020!\022\031\n\025eDispatch_request_msg\020\"\022"
-      "\032\n\026eDispatch_response_msg\020#\022$\n eParkspac"
-      "e_allocation_status_msg\0201\022%\n!eParkspace_"
-      "allocation_request_msg\0202\022&\n\"eParkspace_a"
-      "llocation_response_msg\0203\022!\n\035eParkspace_s"
-      "earch_request_msg\0204\022\"\n\036eParkspace_search"
-      "_response_msg\0205\022\"\n\036eParkspace_release_re"
-      "quest_msg\0206\022#\n\037eParkspace_release_respon"
-      "se_msg\0207\022\'\n#eParkspace_force_update_requ"
-      "est_msg\0208\022(\n$eParkspace_force_update_res"
-      "ponse_msg\0209\022(\n$eParkspace_confirm_alloc_"
-      "request_msg\020:\022)\n%eParkspace_confirm_allo"
-      "c_response_msg\020;\022\036\n\032eStore_command_reque"
-      "st_msg\020A\022\037\n\033eStore_command_response_msg\020"
-      "B\022\037\n\033ePickup_command_request_msg\020C\022 \n\034eP"
-      "ickup_command_response_msg\020D\022\037\n\032eStoring"
-      "_process_statu_msg\020\220\001\022\037\n\032ePicking_proces"
-      "s_statu_msg\020\221\001*f\n\014Communicator\022\n\n\006eEmpty"
-      "\020\000\022\t\n\005eMain\020\001\022\016\n\teTerminor\020\200\002\022\017\n\neParksp"
-      "ace\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\013E"
+      "\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*q\n\020Parkspace_status\022\024"
       "\n\020eParkspace_empty\020\000\022\027\n\023eParkspace_occup"
       "ied\020\001\022\030\n\024eParkspace_reserverd\020\002\022\024\n\020ePark"
       "space_error\020\003*(\n\tDirection\022\014\n\010eForward\020\001"
-      "\022\r\n\teBackward\020\002"
+      "\022\r\n\teBackward\020\002*\335\002\n\tStep_type\022\017\n\013eAlloc_"
+      "step\020\000\022\021\n\reMeasure_step\020\001\022\021\n\reCompare_st"
+      "ep\020\002\022\022\n\016eDispatch_step\020\003\022\021\n\reConfirm_ste"
+      "p\020\004\022\020\n\014eSearch_step\020\005\022\016\n\neWait_step\020\006\022\021\n"
+      "\reRelease_step\020\007\022\r\n\teComplete\020\010\022\025\n\021eBack"
+      "Confirm_step\020\t\022\026\n\022eBack_compare_step\020\n\022\025"
+      "\n\021eBackMeasure_step\020\013\022\023\n\017eBackAlloc_step"
+      "\020\014\022\022\n\016eBackWait_step\020\r\022\026\n\022eBackDispatch_"
+      "step\020\016\022\024\n\020eBackSearch_step\020\017\022\021\n\reBackCom"
+      "plete\020\020*C\n\nStep_statu\022\014\n\010eWaiting\020\000\022\014\n\010e"
+      "Working\020\001\022\n\n\006eError\020\002\022\r\n\teFinished\020\003"
   };
   ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
-      descriptor, 2255);
+      descriptor, 2716);
   ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
     "message_base.proto", &protobuf_RegisterTypes);
 }
@@ -465,6 +437,9 @@ bool Message_type_IsValid(int value) {
     case 68:
     case 144:
     case 145:
+    case 160:
+    case 176:
+    case 177:
       return true;
     default:
       return false;
@@ -489,11 +464,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:
@@ -550,6 +525,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;
+  }
+}
+
 
 // ===================================================================
 
@@ -959,408 +979,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::kPlaceFieldNumber;
-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_);
-  }
-  place_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_place()) {
-    place_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.place_);
-  }
-  event_ = from.event_;
-  // @@protoc_insertion_point(copy_constructor:message.Command_info)
-}
-
-void Command_info::SharedCtor() {
-  _cached_size_ = 0;
-  time_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  place_.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());
-  place_.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(!place_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*place_.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 place = 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_place()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->place().data(), static_cast<int>(this->place().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "message.Command_info.place");
-        } 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 place = 2;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->place().data(), static_cast<int>(this->place().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "message.Command_info.place");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      2, this->place(), 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 place = 2;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->place().data(), static_cast<int>(this->place().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "message.Command_info.place");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        2, this->place(), 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_place()) {
-    // required string place = 2;
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->place());
-  }
-
-  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 place = 2;
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->place());
-
-    // 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_place();
-      place_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.place_);
-    }
-    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_);
-  place_.Swap(&other->place_);
-  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() {

+ 91 - 335
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,
@@ -238,6 +235,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) */ {
@@ -383,155 +435,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 place = 2;
-  bool has_place() const;
-  void clear_place();
-  static const int kPlaceFieldNumber = 2;
-  const ::std::string& place() const;
-  void set_place(const ::std::string& value);
-  #if LANG_CXX11
-  void set_place(::std::string&& value);
-  #endif
-  void set_place(const char* value);
-  void set_place(const char* value, size_t size);
-  ::std::string* mutable_place();
-  ::std::string* release_place();
-  void set_allocated_place(::std::string* place);
-
-  // 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_place();
-  void clear_has_place();
-  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 place_;
-  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();
@@ -574,7 +477,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) {
@@ -686,7 +589,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) {
@@ -824,7 +727,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) {
@@ -1014,7 +917,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) {
@@ -1162,7 +1065,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) {
@@ -1458,161 +1361,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 place = 2;
-inline bool Command_info::has_place() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void Command_info::set_has_place() {
-  _has_bits_[0] |= 0x00000002u;
-}
-inline void Command_info::clear_has_place() {
-  _has_bits_[0] &= ~0x00000002u;
-}
-inline void Command_info::clear_place() {
-  place_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_place();
-}
-inline const ::std::string& Command_info::place() const {
-  // @@protoc_insertion_point(field_get:message.Command_info.place)
-  return place_.GetNoArena();
-}
-inline void Command_info::set_place(const ::std::string& value) {
-  set_has_place();
-  place_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
-  // @@protoc_insertion_point(field_set:message.Command_info.place)
-}
-#if LANG_CXX11
-inline void Command_info::set_place(::std::string&& value) {
-  set_has_place();
-  place_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:message.Command_info.place)
-}
-#endif
-inline void Command_info::set_place(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_place();
-  place_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:message.Command_info.place)
-}
-inline void Command_info::set_place(const char* value, size_t size) {
-  set_has_place();
-  place_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:message.Command_info.place)
-}
-inline ::std::string* Command_info::mutable_place() {
-  set_has_place();
-  // @@protoc_insertion_point(field_mutable:message.Command_info.place)
-  return place_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-inline ::std::string* Command_info::release_place() {
-  // @@protoc_insertion_point(field_release:message.Command_info.place)
-  clear_has_place();
-  return place_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-inline void Command_info::set_allocated_place(::std::string* place) {
-  if (place != NULL) {
-    set_has_place();
-  } else {
-    clear_has_place();
-  }
-  place_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), place);
-  // @@protoc_insertion_point(field_set_allocated:message.Command_info.place)
-}
-
-// 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;
@@ -2535,8 +2283,6 @@ inline void Parkspace_info::set_allocated_leave_time(::std::string* leave_time)
 
 // -------------------------------------------------------------------
 
-// -------------------------------------------------------------------
-
 
 // @@protoc_insertion_point(namespace_scope)
 
@@ -2555,10 +2301,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 <>
@@ -2575,6 +2321,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

@@ -12,7 +12,7 @@ enum Message_type
     eLocate_request_msg=0x12;               //定位请求消息
     eLocate_response_msg=0x13;              //定位反馈消息
 
-    eDispatch_manager_status_msg=0x20;                //调度管理的模块硬件状态消息
+
     eDispatch_status_msg=0x21;                //调度模块硬件状态消息
     eDispatch_request_msg=0x22;              //请求调度消息
     eDispatch_response_msg=0x23;             //调度结果反馈消息
@@ -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                     place=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;           //车长
@@ -151,7 +149,7 @@ enum Direction
     eBackward = 2;
 }
 
-//单个车位基本信息与状态信息
+//单个车位基本信息与状态信息,车位信息以及车位上的车辆信息
 message Parkspace_info
 {
     optional int32              parkspace_id=1;         //车位编号
@@ -165,4 +163,41 @@ message Parkspace_info
     optional Car_info           car_info=9;              //当前车位存入车辆的凭证号
     optional string             entry_time=10;          //入场时间
     optional string             leave_time=11;          //离场时间
+}
+
+/*
+*流程中的步骤类型, 例如:停车流程包含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;
 }

+ 2 - 1
setting/communication.prototxt

@@ -15,7 +15,8 @@ communication_parameters
 
 #    bind_string:"tcp://192.168.2.192:30002"
  #   bind_string:"tcp://192.168.2.167:30002"
-    connect_string_vector:"tcp://192.168.2.183:30003"
+  #  connect_string_vector:"tcp://192.168.2.183:30003"
+    connect_string_vector:"tcp://192.168.2.183:30000"
 
 
 }

+ 1 - 13
system/system_communication.cpp

@@ -21,19 +21,7 @@ System_communication::~System_communication()
 //检查消息是否有效, 主要检查消息类型和接受者, 判断这条消息是不是给我的.
 Error_manager System_communication::check_msg(Communication_message*  p_msg)
 {
-
-	//通过 p_msg->get_message_type() 和 p_msg->get_receiver() 判断这条消息是不是给我的.
-	if ( p_msg->get_message_type() == Communication_message::Message_type::eDispatch_request_msg
-		 && p_msg->get_receiver() == Communication_message::Communicator::eDispatch )
-	{
-		return Error_code::SUCCESS;
-	}
-	else
-	{
-//		std::cout << "System_communication::check_msg INVALID_MESSAGE" << std::endl;
-		//无效的消息,
-		return Error_code::INVALID_MESSAGE;
-	}
+	return System_executor::get_instance_references().check_msg(p_msg);
 }
 
 //检查执行者的状态, 判断能否处理这条消息, 需要子类重载

+ 106 - 16
system/system_executor.cpp

@@ -36,6 +36,47 @@ Error_manager System_executor::system_executor_uninit()
 	return Error_code::SUCCESS;
 }
 
+//检查消息是否有效, 主要检查消息类型和接受者, 判断这条消息是不是给我的.
+Error_manager System_executor::check_msg(Communication_message* p_msg)
+{
+	if ( p_msg == NULL )
+	{
+		return Error_manager(Error_code::POINTER_IS_NULL, Error_level::MINOR_ERROR,
+							 "  POINTER IS NULL ");
+	}
+
+	//检查消息类型
+	switch ( p_msg->get_message_type() )
+	{
+		case Communication_message::Message_type::eDispatch_request_msg:
+		{
+			//检查接受人
+			if ( p_msg->get_receiver() == Communication_message::Communicator::eDispatch )
+			{
+				message::Dispatch_request_msg t_dispatch_request_msg;
+				//针对消息类型, 对消息进行二次解析
+				if (t_dispatch_request_msg.ParseFromString(p_msg->get_message_buf()))
+				{
+					int t_dispatch_id = Dispatch_manager::get_instance_references().get_dispatch_id();
+					//检查终端id
+					if ( t_dispatch_request_msg.terminal_id() == t_dispatch_id*2+0 || t_dispatch_request_msg.terminal_id() == t_dispatch_id*2+1)
+					{
+						return Error_code::SUCCESS;
+					}
+				}
+			}
+			break;
+		}
+		default :
+			;
+			break;
+	}
+
+
+	//无效的消息,
+	return Error_manager(Error_code::INVALID_MESSAGE, Error_level::NEGLIGIBLE_ERROR,
+						 " INVALID_MESSAGE error ");
+}
 //检查执行者的状态, 判断能否处理这条消息,
 Error_manager System_executor::check_executer(Communication_message* p_msg)
 {
@@ -72,7 +113,7 @@ Error_manager System_executor::check_executer(Communication_message* p_msg)
 				}
 				else//返回二级故障,可以封装一条答复信息, 返回错误码
 				{
-					message::Dispatch_response_msg t_dispatch_request_msg;
+					message::Dispatch_request_msg t_dispatch_request_msg;
 					//针对消息类型, 对消息进行二次解析
 					if (t_dispatch_request_msg.ParseFromString(p_msg->get_message_buf()))
 					{
@@ -83,7 +124,7 @@ Error_manager System_executor::check_executer(Communication_message* p_msg)
 						t_dispatch_response_msg.mutable_base_info()->set_sender(message::Communicator::eDispatch);
 						t_dispatch_response_msg.mutable_base_info()->set_receiver(message::Communicator::eMain);
 
-						t_dispatch_response_msg.mutable_command_info()->CopyFrom(t_dispatch_request_msg.command_info());
+						t_dispatch_response_msg.set_command_key(t_dispatch_request_msg.command_key());
 						t_dispatch_response_msg.mutable_error_manager()->set_error_code(t_error.get_error_code());
 						t_dispatch_response_msg.mutable_error_manager()->set_error_level((message::Error_level)t_error.get_error_level());
 						t_dispatch_response_msg.mutable_error_manager()->set_error_description(t_error.get_error_description());
@@ -131,7 +172,7 @@ Error_manager System_executor::execute_msg(Communication_message* p_msg)
 			{
 				//往线程池添加执行任务, 之后会唤醒一个线程去执行他.
 				m_thread_pool.enqueue(&System_executor::execute_for_measure, this,
-									  t_measure_request_msg.command_info(), t_measure_request_msg.terminal_id());
+									  t_measure_request_msg.command_key(), t_measure_request_msg.terminal_id());
 			}
 			else
 			{
@@ -163,7 +204,7 @@ Error_manager System_executor::execute_msg(Communication_message* p_msg)
 				}
 				//往线程池添加执行任务, 之后会唤醒一个线程去执行他.
 				m_thread_pool.enqueue(&System_executor::execute_for_dispatch, this,
-									  t_dispatch_request_msg.command_info(),
+									  t_dispatch_request_msg.command_key(),
 									  (Dispatch_manager::Dispatch_motion_direction)t_dispatch_request_msg.dispatch_motion_direction(),
 									  t_dispatch_request_msg.terminal_id(),
 									  t_dispatch_request_msg.parkspace_id(),
@@ -210,19 +251,68 @@ Error_manager System_executor::check_status()
 Error_manager System_executor::encapsulate_send_status()
 {
 	Error_manager t_error;
-	//创建一条状态消息
-	message::Dispatch_status_msg t_dispatch_status_msg;
-	t_dispatch_status_msg.mutable_base_info()->set_msg_type(message::Message_type::eDispatch_status_msg);
-	t_dispatch_status_msg.mutable_base_info()->set_timeout_ms(5000);
-	t_dispatch_status_msg.mutable_base_info()->set_sender(message::Communicator::eDispatch);
-	t_dispatch_status_msg.mutable_base_info()->set_receiver(message::Communicator::eMain);
+
+	int t_dispatch_id = Dispatch_manager::get_instance_references().get_dispatch_id();
+	std::string t_msg;
+/*
+	//创建一条 调度管理总管理的状态
+	message::Dispatch_manager_status_msg t_dispatch_manager_status_msg;
+	t_dispatch_manager_status_msg.mutable_base_info()->set_msg_type(message::Message_type::eDispatch_manager_status_msg);
+	t_dispatch_manager_status_msg.mutable_base_info()->set_timeout_ms(5000);
+	t_dispatch_manager_status_msg.mutable_base_info()->set_sender(message::Communicator::eDispatch);
+	t_dispatch_manager_status_msg.mutable_base_info()->set_receiver(message::Communicator::eMain);
+
+	t_dispatch_manager_status_msg.set_dispatch_id(t_dispatch_id);
 
 	Dispatch_manager::Dispatch_manager_status t_dispatch_manager_status = Dispatch_manager::get_instance_references().get_dispatch_manager_status();
-	t_dispatch_status_msg.set_dispatch_manager_status((message::Dispatch_manager_status)t_dispatch_manager_status);
+	t_dispatch_manager_status_msg.set_dispatch_manager_status((message::Dispatch_manager_status)t_dispatch_manager_status);
+
+	t_msg = t_dispatch_manager_status_msg.SerializeAsString();
+	System_communication::get_instance_references().encapsulate_msg(t_msg);
+*/
+
+
+	//创建4条 调度模块终端出入口的状态
+	message::Dispatch_terminal_status_msg t_dispatch_terminal_status_msg;
+	t_dispatch_terminal_status_msg.mutable_base_info()->set_msg_type(message::Message_type::eDispatch_status_msg);
+	t_dispatch_terminal_status_msg.mutable_base_info()->set_timeout_ms(5000);
+	t_dispatch_terminal_status_msg.mutable_base_info()->set_sender(message::Communicator::eDispatch);
+	t_dispatch_terminal_status_msg.mutable_base_info()->set_receiver(message::Communicator::eMain);
+	t_dispatch_terminal_status_msg.set_terminal_id(t_dispatch_id*2+0);
+	t_dispatch_terminal_status_msg.set_terminal_status(message::Terminal_status::E_TERMINAL_READY);
+	t_dispatch_terminal_status_msg.set_passageway_direction(message::Passageway_direction::E_INLET);
+	t_msg = t_dispatch_terminal_status_msg.SerializeAsString();
+	System_communication::get_instance_references().encapsulate_msg(t_msg);
+
+	t_dispatch_terminal_status_msg.mutable_base_info()->set_msg_type(message::Message_type::eDispatch_status_msg);
+	t_dispatch_terminal_status_msg.mutable_base_info()->set_timeout_ms(5000);
+	t_dispatch_terminal_status_msg.mutable_base_info()->set_sender(message::Communicator::eDispatch);
+	t_dispatch_terminal_status_msg.mutable_base_info()->set_receiver(message::Communicator::eMain);
+	t_dispatch_terminal_status_msg.set_terminal_id(t_dispatch_id*2+0);
+	t_dispatch_terminal_status_msg.set_terminal_status(message::Terminal_status::E_TERMINAL_READY);
+	t_dispatch_terminal_status_msg.set_passageway_direction(message::Passageway_direction::E_OUTLET);
+	t_msg = t_dispatch_terminal_status_msg.SerializeAsString();
+	System_communication::get_instance_references().encapsulate_msg(t_msg);
 
-	std::string t_msg = t_dispatch_status_msg.SerializeAsString();
+	t_dispatch_terminal_status_msg.mutable_base_info()->set_msg_type(message::Message_type::eDispatch_status_msg);
+	t_dispatch_terminal_status_msg.mutable_base_info()->set_timeout_ms(5000);
+	t_dispatch_terminal_status_msg.mutable_base_info()->set_sender(message::Communicator::eDispatch);
+	t_dispatch_terminal_status_msg.mutable_base_info()->set_receiver(message::Communicator::eMain);
+	t_dispatch_terminal_status_msg.set_terminal_id(t_dispatch_id*2+1);
+	t_dispatch_terminal_status_msg.set_terminal_status(message::Terminal_status::E_TERMINAL_READY);
+	t_dispatch_terminal_status_msg.set_passageway_direction(message::Passageway_direction::E_INLET);
+	t_msg = t_dispatch_terminal_status_msg.SerializeAsString();
 	System_communication::get_instance_references().encapsulate_msg(t_msg);
 
+	t_dispatch_terminal_status_msg.mutable_base_info()->set_msg_type(message::Message_type::eDispatch_status_msg);
+	t_dispatch_terminal_status_msg.mutable_base_info()->set_timeout_ms(5000);
+	t_dispatch_terminal_status_msg.mutable_base_info()->set_sender(message::Communicator::eDispatch);
+	t_dispatch_terminal_status_msg.mutable_base_info()->set_receiver(message::Communicator::eMain);
+	t_dispatch_terminal_status_msg.set_terminal_id(t_dispatch_id*2+1);
+	t_dispatch_terminal_status_msg.set_terminal_status(message::Terminal_status::E_TERMINAL_READY);
+	t_dispatch_terminal_status_msg.set_passageway_direction(message::Passageway_direction::E_OUTLET);
+	t_msg = t_dispatch_terminal_status_msg.SerializeAsString();
+	System_communication::get_instance_references().encapsulate_msg(t_msg);
 	return Error_code::SUCCESS;
 }
 
@@ -251,7 +341,7 @@ System_executor::System_executor_status System_executor::get_system_executor_sta
 //input::command_id, 消息指令id, 由主控制系统生成的唯一码
 //input::command_id, 终端id, 对应具体的某个车位
 //return::void, 没有返回, 执行结果直接生成一条答复消息, 然后通过通信返回
-void System_executor::execute_for_measure(message::Command_info command_info, int terminal_id)
+void System_executor::execute_for_measure(std::string command_key, int terminal_id)
 {
 	Error_manager t_error;
 
@@ -265,7 +355,7 @@ void System_executor::execute_for_measure(message::Command_info command_info, in
 	t_measure_response_msg.mutable_base_info()->set_sender(message::Communicator::eMeasurer);
 	t_measure_response_msg.mutable_base_info()->set_receiver(message::Communicator::eMain);
 
-	t_measure_response_msg.mutable_command_info()->CopyFrom(command_info);
+	t_measure_response_msg.set_command_key(command_key);
 	t_measure_response_msg.set_terminal_id(terminal_id);
 	t_measure_response_msg.mutable_error_manager()->set_error_code(t_error.get_error_code());
 	t_measure_response_msg.mutable_error_manager()->set_error_level((message::Error_level)t_error.get_error_level());
@@ -290,7 +380,7 @@ void System_executor::execute_for_measure(message::Command_info command_info, in
 
 
 //调度模块的处理函数
-void System_executor::execute_for_dispatch(message::Command_info command_info, Dispatch_manager::Dispatch_motion_direction dispatch_motion_direction,
+void System_executor::execute_for_dispatch(std::string command_key, Dispatch_manager::Dispatch_motion_direction dispatch_motion_direction,
 										   int terminal_id, int parkspace_id, Locate_information * p_locate_information)
 {
 	Error_manager t_error;
@@ -307,7 +397,7 @@ void System_executor::execute_for_dispatch(message::Command_info command_info, D
 	t_dispatch_response_msg.mutable_base_info()->set_sender(message::Communicator::eDispatch);
 	t_dispatch_response_msg.mutable_base_info()->set_receiver(message::Communicator::eMain);
 
-	t_dispatch_response_msg.mutable_command_info()->CopyFrom(command_info);
+	t_dispatch_response_msg.set_command_key(command_key);
 	t_dispatch_response_msg.mutable_error_manager()->set_error_code(t_error.get_error_code());
 	t_dispatch_response_msg.mutable_error_manager()->set_error_level((message::Error_level)t_error.get_error_level());
 	t_dispatch_response_msg.mutable_error_manager()->set_error_description(t_error.get_error_description(), t_error.get_description_length());

+ 4 - 2
system/system_executor.h

@@ -43,6 +43,8 @@ public://API functions
 	//反初始化
 	Error_manager system_executor_uninit();
 
+	//检查消息是否有效, 主要检查消息类型和接受者, 判断这条消息是不是给我的.
+	Error_manager check_msg(Communication_message* p_msg);
 	//检查执行者的状态, 判断能否处理这条消息,
 	Error_manager check_executer(Communication_message* p_msg);
 	//处理消息的执行函数
@@ -63,10 +65,10 @@ public:
 //input::command_id, 消息指令id, 由主控制系统生成的唯一码
 //input::command_id, 终端id, 对应具体的某个车位
 //return::void, 没有返回, 执行结果直接生成一条答复消息, 然后通过通信返回
-	void execute_for_measure(message::Command_info command_info, int terminal_id);
+	void execute_for_measure(std::string command_key, int terminal_id);
 
 	//调度模块的处理函数
-	void execute_for_dispatch(message::Command_info command_info, Dispatch_manager::Dispatch_motion_direction dispatch_motion_direction,
+	void execute_for_dispatch(std::string command_key, Dispatch_manager::Dispatch_motion_direction dispatch_motion_direction,
 							  int terminal_id, int parkspace_id, Locate_information * p_locate_information);
 
 protected://member variable