瀏覽代碼

20210707, 调度 稳定版 修改message Parkspace_info

huli 4 年之前
父節點
當前提交
3c526b0756

+ 36 - 1
dispatch/dispatch_process.cpp

@@ -4953,11 +4953,46 @@ Error_manager Dispatch_process::send_dispatch_response_msg()
 	m_dispatch_response_msg.mutable_base_info()->set_receiver(message::Communicator::eMain);
 	m_dispatch_response_msg.mutable_base_info()->set_receiver(message::Communicator::eMain);
 	m_dispatch_response_msg.set_command_key(m_dispatch_request_msg.command_key());
 	m_dispatch_response_msg.set_command_key(m_dispatch_request_msg.command_key());
 
 
+	m_dispatch_response_msg.set_dispatch_motion_direction(m_dispatch_request_msg.dispatch_motion_direction());
+	m_dispatch_response_msg.set_terminal_id(m_dispatch_request_msg.terminal_id());
+	m_dispatch_response_msg.mutable_locate_information()->CopyFrom(m_dispatch_request_msg.locate_information());
+	m_dispatch_response_msg.mutable_parkspace_info_ex()->CopyFrom(m_dispatch_request_msg.parkspace_info_ex());
+	m_dispatch_response_msg.set_car_type(m_dispatch_request_msg.car_type());
+
+	if ( m_dispatch_response_msg.dispatch_motion_direction() == message::E_STORE_CAR )
+	{
+		for (int i = 0; i < m_dispatch_response_msg.parkspace_info_ex_size(); ++i)
+		{
+			if ( m_dispatch_destination == m_dispatch_response_msg.parkspace_info_ex(i).parkingspace_index_id() )
+			{
+				m_dispatch_response_msg.mutable_parkspace_info_ex(i)->set_parkspace_status_target(message::Parkspace_status::eParkspace_occupied);
+			}
+			else
+			{
+				m_dispatch_response_msg.mutable_parkspace_info_ex(i)->set_parkspace_status_target(message::Parkspace_status::eParkspace_empty);
+			}
+		}
+	}
+	else if( m_dispatch_response_msg.dispatch_motion_direction() == message::E_PICKUP_CAR )
+	{
+		for (int i = 0; i < m_dispatch_response_msg.parkspace_info_ex_size(); ++i)
+		{
+			if ( m_dispatch_source == m_dispatch_response_msg.parkspace_info_ex(i).parkingspace_index_id() )
+			{
+				m_dispatch_response_msg.mutable_parkspace_info_ex(i)->set_parkspace_status_target(message::Parkspace_status::eParkspace_occupied);
+			}
+			else
+			{
+				m_dispatch_response_msg.mutable_parkspace_info_ex(i)->set_parkspace_status_target(message::Parkspace_status::eParkspace_empty);
+			}
+		}
+	}
+
+
 	m_dispatch_response_msg.mutable_error_manager()->set_error_code(m_result.get_error_code());
 	m_dispatch_response_msg.mutable_error_manager()->set_error_code(m_result.get_error_code());
 	m_dispatch_response_msg.mutable_error_manager()->set_error_level((message::Error_level)m_result.get_error_level());
 	m_dispatch_response_msg.mutable_error_manager()->set_error_level((message::Error_level)m_result.get_error_level());
 	m_dispatch_response_msg.mutable_error_manager()->set_error_description(m_result.get_error_description());
 	m_dispatch_response_msg.mutable_error_manager()->set_error_description(m_result.get_error_description());
 
 
-
 	std::string t_msg = m_dispatch_response_msg.SerializeAsString();
 	std::string t_msg = m_dispatch_response_msg.SerializeAsString();
 	System_communication::get_instance_references().encapsulate_msg(t_msg);
 	System_communication::get_instance_references().encapsulate_msg(t_msg);
 	return Error_code::SUCCESS;
 	return Error_code::SUCCESS;

+ 1 - 1
error_code/error_code.h

@@ -1,7 +1,7 @@
 
 
 #define MAIN_TEST 1
 #define MAIN_TEST 1
 //#define PROCESS_TEST 1
 //#define PROCESS_TEST 1
-#define TIME_TEST 1
+//#define TIME_TEST 1
 
 
 //Error_code是错误码的底层通用模块,
 //Error_code是错误码的底层通用模块,
 //功能:用作故障分析和处理。
 //功能:用作故障分析和处理。

文件差異過大導致無法顯示
+ 226 - 339
message/dispatch_message.pb.cc


+ 48 - 172
message/dispatch_message.pb.h

@@ -651,10 +651,10 @@ class Dispatch_request_msg : public ::google::protobuf::Message /* @@protoc_inse
 
 
   // accessors -------------------------------------------------------
   // accessors -------------------------------------------------------
 
 
-  // repeated .message.Parkspace_info parkspace_info_ex = 7;
+  // repeated .message.Parkspace_info parkspace_info_ex = 6;
   int parkspace_info_ex_size() const;
   int parkspace_info_ex_size() const;
   void clear_parkspace_info_ex();
   void clear_parkspace_info_ex();
-  static const int kParkspaceInfoExFieldNumber = 7;
+  static const int kParkspaceInfoExFieldNumber = 6;
   const ::message::Parkspace_info& parkspace_info_ex(int index) const;
   const ::message::Parkspace_info& parkspace_info_ex(int index) const;
   ::message::Parkspace_info* mutable_parkspace_info_ex(int index);
   ::message::Parkspace_info* mutable_parkspace_info_ex(int index);
   ::message::Parkspace_info* add_parkspace_info_ex();
   ::message::Parkspace_info* add_parkspace_info_ex();
@@ -687,19 +687,10 @@ class Dispatch_request_msg : public ::google::protobuf::Message /* @@protoc_inse
   ::message::Base_info* mutable_base_info();
   ::message::Base_info* mutable_base_info();
   void set_allocated_base_info(::message::Base_info* base_info);
   void set_allocated_base_info(::message::Base_info* base_info);
 
 
-  // optional .message.Parkspace_info parkspace_info = 5;
-  bool has_parkspace_info() const;
-  void clear_parkspace_info();
-  static const int kParkspaceInfoFieldNumber = 5;
-  const ::message::Parkspace_info& parkspace_info() const;
-  ::message::Parkspace_info* release_parkspace_info();
-  ::message::Parkspace_info* mutable_parkspace_info();
-  void set_allocated_parkspace_info(::message::Parkspace_info* parkspace_info);
-
-  // optional .message.Locate_information locate_information = 6;
+  // optional .message.Locate_information locate_information = 5;
   bool has_locate_information() const;
   bool has_locate_information() const;
   void clear_locate_information();
   void clear_locate_information();
-  static const int kLocateInformationFieldNumber = 6;
+  static const int kLocateInformationFieldNumber = 5;
   const ::message::Locate_information& locate_information() const;
   const ::message::Locate_information& locate_information() const;
   ::message::Locate_information* release_locate_information();
   ::message::Locate_information* release_locate_information();
   ::message::Locate_information* mutable_locate_information();
   ::message::Locate_information* mutable_locate_information();
@@ -719,10 +710,10 @@ class Dispatch_request_msg : public ::google::protobuf::Message /* @@protoc_inse
   ::google::protobuf::int32 terminal_id() const;
   ::google::protobuf::int32 terminal_id() const;
   void set_terminal_id(::google::protobuf::int32 value);
   void set_terminal_id(::google::protobuf::int32 value);
 
 
-  // optional .message.Car_type car_type = 8;
+  // optional .message.Car_type car_type = 7;
   bool has_car_type() const;
   bool has_car_type() const;
   void clear_car_type();
   void clear_car_type();
-  static const int kCarTypeFieldNumber = 8;
+  static const int kCarTypeFieldNumber = 7;
   ::message::Car_type car_type() const;
   ::message::Car_type car_type() const;
   void set_car_type(::message::Car_type value);
   void set_car_type(::message::Car_type value);
 
 
@@ -736,8 +727,6 @@ class Dispatch_request_msg : public ::google::protobuf::Message /* @@protoc_inse
   void clear_has_dispatch_motion_direction();
   void clear_has_dispatch_motion_direction();
   void set_has_terminal_id();
   void set_has_terminal_id();
   void clear_has_terminal_id();
   void clear_has_terminal_id();
-  void set_has_parkspace_info();
-  void clear_has_parkspace_info();
   void set_has_locate_information();
   void set_has_locate_information();
   void clear_has_locate_information();
   void clear_has_locate_information();
   void set_has_car_type();
   void set_has_car_type();
@@ -752,7 +741,6 @@ class Dispatch_request_msg : public ::google::protobuf::Message /* @@protoc_inse
   ::google::protobuf::RepeatedPtrField< ::message::Parkspace_info > parkspace_info_ex_;
   ::google::protobuf::RepeatedPtrField< ::message::Parkspace_info > parkspace_info_ex_;
   ::google::protobuf::internal::ArenaStringPtr command_key_;
   ::google::protobuf::internal::ArenaStringPtr command_key_;
   ::message::Base_info* base_info_;
   ::message::Base_info* base_info_;
-  ::message::Parkspace_info* parkspace_info_;
   ::message::Locate_information* locate_information_;
   ::message::Locate_information* locate_information_;
   int dispatch_motion_direction_;
   int dispatch_motion_direction_;
   ::google::protobuf::int32 terminal_id_;
   ::google::protobuf::int32 terminal_id_;
@@ -851,10 +839,10 @@ class Dispatch_response_msg : public ::google::protobuf::Message /* @@protoc_ins
 
 
   // accessors -------------------------------------------------------
   // accessors -------------------------------------------------------
 
 
-  // repeated .message.Parkspace_info parkspace_info_ex = 7;
+  // repeated .message.Parkspace_info parkspace_info_ex = 6;
   int parkspace_info_ex_size() const;
   int parkspace_info_ex_size() const;
   void clear_parkspace_info_ex();
   void clear_parkspace_info_ex();
-  static const int kParkspaceInfoExFieldNumber = 7;
+  static const int kParkspaceInfoExFieldNumber = 6;
   const ::message::Parkspace_info& parkspace_info_ex(int index) const;
   const ::message::Parkspace_info& parkspace_info_ex(int index) const;
   ::message::Parkspace_info* mutable_parkspace_info_ex(int index);
   ::message::Parkspace_info* mutable_parkspace_info_ex(int index);
   ::message::Parkspace_info* add_parkspace_info_ex();
   ::message::Parkspace_info* add_parkspace_info_ex();
@@ -887,28 +875,19 @@ class Dispatch_response_msg : public ::google::protobuf::Message /* @@protoc_ins
   ::message::Base_info* mutable_base_info();
   ::message::Base_info* mutable_base_info();
   void set_allocated_base_info(::message::Base_info* base_info);
   void set_allocated_base_info(::message::Base_info* base_info);
 
 
-  // optional .message.Parkspace_info parkspace_info = 5;
-  bool has_parkspace_info() const;
-  void clear_parkspace_info();
-  static const int kParkspaceInfoFieldNumber = 5;
-  const ::message::Parkspace_info& parkspace_info() const;
-  ::message::Parkspace_info* release_parkspace_info();
-  ::message::Parkspace_info* mutable_parkspace_info();
-  void set_allocated_parkspace_info(::message::Parkspace_info* parkspace_info);
-
-  // optional .message.Locate_information locate_information = 6;
+  // optional .message.Locate_information locate_information = 5;
   bool has_locate_information() const;
   bool has_locate_information() const;
   void clear_locate_information();
   void clear_locate_information();
-  static const int kLocateInformationFieldNumber = 6;
+  static const int kLocateInformationFieldNumber = 5;
   const ::message::Locate_information& locate_information() const;
   const ::message::Locate_information& locate_information() const;
   ::message::Locate_information* release_locate_information();
   ::message::Locate_information* release_locate_information();
   ::message::Locate_information* mutable_locate_information();
   ::message::Locate_information* mutable_locate_information();
   void set_allocated_locate_information(::message::Locate_information* locate_information);
   void set_allocated_locate_information(::message::Locate_information* locate_information);
 
 
-  // optional .message.Error_manager error_manager = 9;
+  // optional .message.Error_manager error_manager = 8;
   bool has_error_manager() const;
   bool has_error_manager() const;
   void clear_error_manager();
   void clear_error_manager();
-  static const int kErrorManagerFieldNumber = 9;
+  static const int kErrorManagerFieldNumber = 8;
   const ::message::Error_manager& error_manager() const;
   const ::message::Error_manager& error_manager() const;
   ::message::Error_manager* release_error_manager();
   ::message::Error_manager* release_error_manager();
   ::message::Error_manager* mutable_error_manager();
   ::message::Error_manager* mutable_error_manager();
@@ -928,10 +907,10 @@ class Dispatch_response_msg : public ::google::protobuf::Message /* @@protoc_ins
   ::google::protobuf::int32 terminal_id() const;
   ::google::protobuf::int32 terminal_id() const;
   void set_terminal_id(::google::protobuf::int32 value);
   void set_terminal_id(::google::protobuf::int32 value);
 
 
-  // optional .message.Car_type car_type = 8;
+  // optional .message.Car_type car_type = 7;
   bool has_car_type() const;
   bool has_car_type() const;
   void clear_car_type();
   void clear_car_type();
-  static const int kCarTypeFieldNumber = 8;
+  static const int kCarTypeFieldNumber = 7;
   ::message::Car_type car_type() const;
   ::message::Car_type car_type() const;
   void set_car_type(::message::Car_type value);
   void set_car_type(::message::Car_type value);
 
 
@@ -945,8 +924,6 @@ class Dispatch_response_msg : public ::google::protobuf::Message /* @@protoc_ins
   void clear_has_dispatch_motion_direction();
   void clear_has_dispatch_motion_direction();
   void set_has_terminal_id();
   void set_has_terminal_id();
   void clear_has_terminal_id();
   void clear_has_terminal_id();
-  void set_has_parkspace_info();
-  void clear_has_parkspace_info();
   void set_has_locate_information();
   void set_has_locate_information();
   void clear_has_locate_information();
   void clear_has_locate_information();
   void set_has_car_type();
   void set_has_car_type();
@@ -963,7 +940,6 @@ class Dispatch_response_msg : public ::google::protobuf::Message /* @@protoc_ins
   ::google::protobuf::RepeatedPtrField< ::message::Parkspace_info > parkspace_info_ex_;
   ::google::protobuf::RepeatedPtrField< ::message::Parkspace_info > parkspace_info_ex_;
   ::google::protobuf::internal::ArenaStringPtr command_key_;
   ::google::protobuf::internal::ArenaStringPtr command_key_;
   ::message::Base_info* base_info_;
   ::message::Base_info* base_info_;
-  ::message::Parkspace_info* parkspace_info_;
   ::message::Locate_information* locate_information_;
   ::message::Locate_information* locate_information_;
   ::message::Error_manager* error_manager_;
   ::message::Error_manager* error_manager_;
   int dispatch_motion_direction_;
   int dispatch_motion_direction_;
@@ -2431,13 +2407,13 @@ inline void Dispatch_request_msg::set_allocated_command_key(::std::string* comma
 
 
 // optional .message.Dispatch_motion_direction dispatch_motion_direction = 3;
 // optional .message.Dispatch_motion_direction dispatch_motion_direction = 3;
 inline bool Dispatch_request_msg::has_dispatch_motion_direction() const {
 inline bool Dispatch_request_msg::has_dispatch_motion_direction() const {
-  return (_has_bits_[0] & 0x00000010u) != 0;
+  return (_has_bits_[0] & 0x00000008u) != 0;
 }
 }
 inline void Dispatch_request_msg::set_has_dispatch_motion_direction() {
 inline void Dispatch_request_msg::set_has_dispatch_motion_direction() {
-  _has_bits_[0] |= 0x00000010u;
+  _has_bits_[0] |= 0x00000008u;
 }
 }
 inline void Dispatch_request_msg::clear_has_dispatch_motion_direction() {
 inline void Dispatch_request_msg::clear_has_dispatch_motion_direction() {
-  _has_bits_[0] &= ~0x00000010u;
+  _has_bits_[0] &= ~0x00000008u;
 }
 }
 inline void Dispatch_request_msg::clear_dispatch_motion_direction() {
 inline void Dispatch_request_msg::clear_dispatch_motion_direction() {
   dispatch_motion_direction_ = 0;
   dispatch_motion_direction_ = 0;
@@ -2456,13 +2432,13 @@ inline void Dispatch_request_msg::set_dispatch_motion_direction(::message::Dispa
 
 
 // optional int32 terminal_id = 4;
 // optional int32 terminal_id = 4;
 inline bool Dispatch_request_msg::has_terminal_id() const {
 inline bool Dispatch_request_msg::has_terminal_id() const {
-  return (_has_bits_[0] & 0x00000020u) != 0;
+  return (_has_bits_[0] & 0x00000010u) != 0;
 }
 }
 inline void Dispatch_request_msg::set_has_terminal_id() {
 inline void Dispatch_request_msg::set_has_terminal_id() {
-  _has_bits_[0] |= 0x00000020u;
+  _has_bits_[0] |= 0x00000010u;
 }
 }
 inline void Dispatch_request_msg::clear_has_terminal_id() {
 inline void Dispatch_request_msg::clear_has_terminal_id() {
-  _has_bits_[0] &= ~0x00000020u;
+  _has_bits_[0] &= ~0x00000010u;
 }
 }
 inline void Dispatch_request_msg::clear_terminal_id() {
 inline void Dispatch_request_msg::clear_terminal_id() {
   terminal_id_ = 0;
   terminal_id_ = 0;
@@ -2478,65 +2454,15 @@ inline void Dispatch_request_msg::set_terminal_id(::google::protobuf::int32 valu
   // @@protoc_insertion_point(field_set:message.Dispatch_request_msg.terminal_id)
   // @@protoc_insertion_point(field_set:message.Dispatch_request_msg.terminal_id)
 }
 }
 
 
-// optional .message.Parkspace_info parkspace_info = 5;
-inline bool Dispatch_request_msg::has_parkspace_info() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
-}
-inline void Dispatch_request_msg::set_has_parkspace_info() {
-  _has_bits_[0] |= 0x00000004u;
-}
-inline void Dispatch_request_msg::clear_has_parkspace_info() {
-  _has_bits_[0] &= ~0x00000004u;
-}
-inline const ::message::Parkspace_info& Dispatch_request_msg::parkspace_info() const {
-  const ::message::Parkspace_info* p = parkspace_info_;
-  // @@protoc_insertion_point(field_get:message.Dispatch_request_msg.parkspace_info)
-  return p != NULL ? *p : *reinterpret_cast<const ::message::Parkspace_info*>(
-      &::message::_Parkspace_info_default_instance_);
-}
-inline ::message::Parkspace_info* Dispatch_request_msg::release_parkspace_info() {
-  // @@protoc_insertion_point(field_release:message.Dispatch_request_msg.parkspace_info)
-  clear_has_parkspace_info();
-  ::message::Parkspace_info* temp = parkspace_info_;
-  parkspace_info_ = NULL;
-  return temp;
-}
-inline ::message::Parkspace_info* Dispatch_request_msg::mutable_parkspace_info() {
-  set_has_parkspace_info();
-  if (parkspace_info_ == NULL) {
-    parkspace_info_ = new ::message::Parkspace_info;
-  }
-  // @@protoc_insertion_point(field_mutable:message.Dispatch_request_msg.parkspace_info)
-  return parkspace_info_;
-}
-inline void Dispatch_request_msg::set_allocated_parkspace_info(::message::Parkspace_info* parkspace_info) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
-    delete reinterpret_cast< ::google::protobuf::MessageLite*>(parkspace_info_);
-  }
-  if (parkspace_info) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
-    if (message_arena != submessage_arena) {
-      parkspace_info = ::google::protobuf::internal::GetOwnedMessage(
-          message_arena, parkspace_info, submessage_arena);
-    }
-    set_has_parkspace_info();
-  } else {
-    clear_has_parkspace_info();
-  }
-  parkspace_info_ = parkspace_info;
-  // @@protoc_insertion_point(field_set_allocated:message.Dispatch_request_msg.parkspace_info)
-}
-
-// optional .message.Locate_information locate_information = 6;
+// optional .message.Locate_information locate_information = 5;
 inline bool Dispatch_request_msg::has_locate_information() const {
 inline bool Dispatch_request_msg::has_locate_information() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
+  return (_has_bits_[0] & 0x00000004u) != 0;
 }
 }
 inline void Dispatch_request_msg::set_has_locate_information() {
 inline void Dispatch_request_msg::set_has_locate_information() {
-  _has_bits_[0] |= 0x00000008u;
+  _has_bits_[0] |= 0x00000004u;
 }
 }
 inline void Dispatch_request_msg::clear_has_locate_information() {
 inline void Dispatch_request_msg::clear_has_locate_information() {
-  _has_bits_[0] &= ~0x00000008u;
+  _has_bits_[0] &= ~0x00000004u;
 }
 }
 inline const ::message::Locate_information& Dispatch_request_msg::locate_information() const {
 inline const ::message::Locate_information& Dispatch_request_msg::locate_information() const {
   const ::message::Locate_information* p = locate_information_;
   const ::message::Locate_information* p = locate_information_;
@@ -2578,7 +2504,7 @@ inline void Dispatch_request_msg::set_allocated_locate_information(::message::Lo
   // @@protoc_insertion_point(field_set_allocated:message.Dispatch_request_msg.locate_information)
   // @@protoc_insertion_point(field_set_allocated:message.Dispatch_request_msg.locate_information)
 }
 }
 
 
-// repeated .message.Parkspace_info parkspace_info_ex = 7;
+// repeated .message.Parkspace_info parkspace_info_ex = 6;
 inline int Dispatch_request_msg::parkspace_info_ex_size() const {
 inline int Dispatch_request_msg::parkspace_info_ex_size() const {
   return parkspace_info_ex_.size();
   return parkspace_info_ex_.size();
 }
 }
@@ -2605,15 +2531,15 @@ Dispatch_request_msg::parkspace_info_ex() const {
   return parkspace_info_ex_;
   return parkspace_info_ex_;
 }
 }
 
 
-// optional .message.Car_type car_type = 8;
+// optional .message.Car_type car_type = 7;
 inline bool Dispatch_request_msg::has_car_type() const {
 inline bool Dispatch_request_msg::has_car_type() const {
-  return (_has_bits_[0] & 0x00000040u) != 0;
+  return (_has_bits_[0] & 0x00000020u) != 0;
 }
 }
 inline void Dispatch_request_msg::set_has_car_type() {
 inline void Dispatch_request_msg::set_has_car_type() {
-  _has_bits_[0] |= 0x00000040u;
+  _has_bits_[0] |= 0x00000020u;
 }
 }
 inline void Dispatch_request_msg::clear_has_car_type() {
 inline void Dispatch_request_msg::clear_has_car_type() {
-  _has_bits_[0] &= ~0x00000040u;
+  _has_bits_[0] &= ~0x00000020u;
 }
 }
 inline void Dispatch_request_msg::clear_car_type() {
 inline void Dispatch_request_msg::clear_car_type() {
   car_type_ = 0;
   car_type_ = 0;
@@ -2749,13 +2675,13 @@ inline void Dispatch_response_msg::set_allocated_command_key(::std::string* comm
 
 
 // optional .message.Dispatch_motion_direction dispatch_motion_direction = 3;
 // optional .message.Dispatch_motion_direction dispatch_motion_direction = 3;
 inline bool Dispatch_response_msg::has_dispatch_motion_direction() const {
 inline bool Dispatch_response_msg::has_dispatch_motion_direction() const {
-  return (_has_bits_[0] & 0x00000020u) != 0;
+  return (_has_bits_[0] & 0x00000010u) != 0;
 }
 }
 inline void Dispatch_response_msg::set_has_dispatch_motion_direction() {
 inline void Dispatch_response_msg::set_has_dispatch_motion_direction() {
-  _has_bits_[0] |= 0x00000020u;
+  _has_bits_[0] |= 0x00000010u;
 }
 }
 inline void Dispatch_response_msg::clear_has_dispatch_motion_direction() {
 inline void Dispatch_response_msg::clear_has_dispatch_motion_direction() {
-  _has_bits_[0] &= ~0x00000020u;
+  _has_bits_[0] &= ~0x00000010u;
 }
 }
 inline void Dispatch_response_msg::clear_dispatch_motion_direction() {
 inline void Dispatch_response_msg::clear_dispatch_motion_direction() {
   dispatch_motion_direction_ = 0;
   dispatch_motion_direction_ = 0;
@@ -2774,13 +2700,13 @@ inline void Dispatch_response_msg::set_dispatch_motion_direction(::message::Disp
 
 
 // optional int32 terminal_id = 4;
 // optional int32 terminal_id = 4;
 inline bool Dispatch_response_msg::has_terminal_id() const {
 inline bool Dispatch_response_msg::has_terminal_id() const {
-  return (_has_bits_[0] & 0x00000040u) != 0;
+  return (_has_bits_[0] & 0x00000020u) != 0;
 }
 }
 inline void Dispatch_response_msg::set_has_terminal_id() {
 inline void Dispatch_response_msg::set_has_terminal_id() {
-  _has_bits_[0] |= 0x00000040u;
+  _has_bits_[0] |= 0x00000020u;
 }
 }
 inline void Dispatch_response_msg::clear_has_terminal_id() {
 inline void Dispatch_response_msg::clear_has_terminal_id() {
-  _has_bits_[0] &= ~0x00000040u;
+  _has_bits_[0] &= ~0x00000020u;
 }
 }
 inline void Dispatch_response_msg::clear_terminal_id() {
 inline void Dispatch_response_msg::clear_terminal_id() {
   terminal_id_ = 0;
   terminal_id_ = 0;
@@ -2796,65 +2722,15 @@ inline void Dispatch_response_msg::set_terminal_id(::google::protobuf::int32 val
   // @@protoc_insertion_point(field_set:message.Dispatch_response_msg.terminal_id)
   // @@protoc_insertion_point(field_set:message.Dispatch_response_msg.terminal_id)
 }
 }
 
 
-// optional .message.Parkspace_info parkspace_info = 5;
-inline bool Dispatch_response_msg::has_parkspace_info() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
-}
-inline void Dispatch_response_msg::set_has_parkspace_info() {
-  _has_bits_[0] |= 0x00000004u;
-}
-inline void Dispatch_response_msg::clear_has_parkspace_info() {
-  _has_bits_[0] &= ~0x00000004u;
-}
-inline const ::message::Parkspace_info& Dispatch_response_msg::parkspace_info() const {
-  const ::message::Parkspace_info* p = parkspace_info_;
-  // @@protoc_insertion_point(field_get:message.Dispatch_response_msg.parkspace_info)
-  return p != NULL ? *p : *reinterpret_cast<const ::message::Parkspace_info*>(
-      &::message::_Parkspace_info_default_instance_);
-}
-inline ::message::Parkspace_info* Dispatch_response_msg::release_parkspace_info() {
-  // @@protoc_insertion_point(field_release:message.Dispatch_response_msg.parkspace_info)
-  clear_has_parkspace_info();
-  ::message::Parkspace_info* temp = parkspace_info_;
-  parkspace_info_ = NULL;
-  return temp;
-}
-inline ::message::Parkspace_info* Dispatch_response_msg::mutable_parkspace_info() {
-  set_has_parkspace_info();
-  if (parkspace_info_ == NULL) {
-    parkspace_info_ = new ::message::Parkspace_info;
-  }
-  // @@protoc_insertion_point(field_mutable:message.Dispatch_response_msg.parkspace_info)
-  return parkspace_info_;
-}
-inline void Dispatch_response_msg::set_allocated_parkspace_info(::message::Parkspace_info* parkspace_info) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
-    delete reinterpret_cast< ::google::protobuf::MessageLite*>(parkspace_info_);
-  }
-  if (parkspace_info) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
-    if (message_arena != submessage_arena) {
-      parkspace_info = ::google::protobuf::internal::GetOwnedMessage(
-          message_arena, parkspace_info, submessage_arena);
-    }
-    set_has_parkspace_info();
-  } else {
-    clear_has_parkspace_info();
-  }
-  parkspace_info_ = parkspace_info;
-  // @@protoc_insertion_point(field_set_allocated:message.Dispatch_response_msg.parkspace_info)
-}
-
-// optional .message.Locate_information locate_information = 6;
+// optional .message.Locate_information locate_information = 5;
 inline bool Dispatch_response_msg::has_locate_information() const {
 inline bool Dispatch_response_msg::has_locate_information() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
+  return (_has_bits_[0] & 0x00000004u) != 0;
 }
 }
 inline void Dispatch_response_msg::set_has_locate_information() {
 inline void Dispatch_response_msg::set_has_locate_information() {
-  _has_bits_[0] |= 0x00000008u;
+  _has_bits_[0] |= 0x00000004u;
 }
 }
 inline void Dispatch_response_msg::clear_has_locate_information() {
 inline void Dispatch_response_msg::clear_has_locate_information() {
-  _has_bits_[0] &= ~0x00000008u;
+  _has_bits_[0] &= ~0x00000004u;
 }
 }
 inline const ::message::Locate_information& Dispatch_response_msg::locate_information() const {
 inline const ::message::Locate_information& Dispatch_response_msg::locate_information() const {
   const ::message::Locate_information* p = locate_information_;
   const ::message::Locate_information* p = locate_information_;
@@ -2896,7 +2772,7 @@ inline void Dispatch_response_msg::set_allocated_locate_information(::message::L
   // @@protoc_insertion_point(field_set_allocated:message.Dispatch_response_msg.locate_information)
   // @@protoc_insertion_point(field_set_allocated:message.Dispatch_response_msg.locate_information)
 }
 }
 
 
-// repeated .message.Parkspace_info parkspace_info_ex = 7;
+// repeated .message.Parkspace_info parkspace_info_ex = 6;
 inline int Dispatch_response_msg::parkspace_info_ex_size() const {
 inline int Dispatch_response_msg::parkspace_info_ex_size() const {
   return parkspace_info_ex_.size();
   return parkspace_info_ex_.size();
 }
 }
@@ -2923,15 +2799,15 @@ Dispatch_response_msg::parkspace_info_ex() const {
   return parkspace_info_ex_;
   return parkspace_info_ex_;
 }
 }
 
 
-// optional .message.Car_type car_type = 8;
+// optional .message.Car_type car_type = 7;
 inline bool Dispatch_response_msg::has_car_type() const {
 inline bool Dispatch_response_msg::has_car_type() const {
-  return (_has_bits_[0] & 0x00000080u) != 0;
+  return (_has_bits_[0] & 0x00000040u) != 0;
 }
 }
 inline void Dispatch_response_msg::set_has_car_type() {
 inline void Dispatch_response_msg::set_has_car_type() {
-  _has_bits_[0] |= 0x00000080u;
+  _has_bits_[0] |= 0x00000040u;
 }
 }
 inline void Dispatch_response_msg::clear_has_car_type() {
 inline void Dispatch_response_msg::clear_has_car_type() {
-  _has_bits_[0] &= ~0x00000080u;
+  _has_bits_[0] &= ~0x00000040u;
 }
 }
 inline void Dispatch_response_msg::clear_car_type() {
 inline void Dispatch_response_msg::clear_car_type() {
   car_type_ = 0;
   car_type_ = 0;
@@ -2948,15 +2824,15 @@ inline void Dispatch_response_msg::set_car_type(::message::Car_type value) {
   // @@protoc_insertion_point(field_set:message.Dispatch_response_msg.car_type)
   // @@protoc_insertion_point(field_set:message.Dispatch_response_msg.car_type)
 }
 }
 
 
-// optional .message.Error_manager error_manager = 9;
+// optional .message.Error_manager error_manager = 8;
 inline bool Dispatch_response_msg::has_error_manager() const {
 inline bool Dispatch_response_msg::has_error_manager() const {
-  return (_has_bits_[0] & 0x00000010u) != 0;
+  return (_has_bits_[0] & 0x00000008u) != 0;
 }
 }
 inline void Dispatch_response_msg::set_has_error_manager() {
 inline void Dispatch_response_msg::set_has_error_manager() {
-  _has_bits_[0] |= 0x00000010u;
+  _has_bits_[0] |= 0x00000008u;
 }
 }
 inline void Dispatch_response_msg::clear_has_error_manager() {
 inline void Dispatch_response_msg::clear_has_error_manager() {
-  _has_bits_[0] &= ~0x00000010u;
+  _has_bits_[0] &= ~0x00000008u;
 }
 }
 inline const ::message::Error_manager& Dispatch_response_msg::error_manager() const {
 inline const ::message::Error_manager& Dispatch_response_msg::error_manager() const {
   const ::message::Error_manager* p = error_manager_;
   const ::message::Error_manager* p = error_manager_;

+ 7 - 9
message/dispatch_message.proto

@@ -49,11 +49,10 @@ message Dispatch_request_msg
 
 
     optional Dispatch_motion_direction  dispatch_motion_direction=3;            //调度方向, 停车取车
     optional Dispatch_motion_direction  dispatch_motion_direction=3;            //调度方向, 停车取车
     optional int32                      terminal_id=4;                          //终端id, 出入口
     optional int32                      terminal_id=4;                          //终端id, 出入口
-    optional Parkspace_info             parkspace_info=5;                         //车位编号, 停车位
-    optional Locate_information         locate_information=6;                   //汽车测量信息, 只有停车时有数据, 取车时没有数据.
+    optional Locate_information         locate_information=5;                   //汽车测量信息, 只有停车时有数据, 取车时没有数据.
 
 
-    repeated Parkspace_info             parkspace_info_ex=7;                         //车位编号, 停车位(B方案, 分配3个停车位)
-    optional Car_type                   car_type=8;                             //汽车大小
+    repeated Parkspace_info             parkspace_info_ex=6;                         //车位编号, 停车位(B方案, 分配3个停车位)
+    optional Car_type                   car_type=7;                             //汽车大小
 }
 }
 
 
 //搬运动作执行完成后反馈结果(调度管理->主控)
 //搬运动作执行完成后反馈结果(调度管理->主控)
@@ -65,13 +64,12 @@ message Dispatch_response_msg
 
 
     optional Dispatch_motion_direction  dispatch_motion_direction=3;            //调度方向, 停车取车
     optional Dispatch_motion_direction  dispatch_motion_direction=3;            //调度方向, 停车取车
     optional int32                      terminal_id=4;                          //终端id, 出入口
     optional int32                      terminal_id=4;                          //终端id, 出入口
-    optional Parkspace_info             parkspace_info=5;                         //车位编号, 停车位
-    optional Locate_information         locate_information=6;                   //汽车测量信息, 只有停车时有数据, 取车时没有数据.
+    optional Locate_information         locate_information=5;                   //汽车测量信息, 只有停车时有数据, 取车时没有数据.
 
 
-    repeated Parkspace_info             parkspace_info_ex=7;                         //车位编号, 停车位(B方案, 分配3个停车位)
-    optional Car_type                   car_type=8;                             //汽车大小
+    repeated Parkspace_info             parkspace_info_ex=6;                         //车位编号, 停车位(B方案, 分配3个停车位)
+    optional Car_type                   car_type=7;                             //汽车大小
 
 
-    optional Error_manager              error_manager = 9;
+    optional Error_manager              error_manager = 8;
 }
 }
 
 
 
 

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


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


+ 153 - 0
message/parkspace_allocation_message.proto

@@ -0,0 +1,153 @@
+syntax = "proto2";
+package message;
+import "message_base.proto";
+
+// 请求
+// 1.分配车位
+// 2.查询车辆位置
+// 3.解锁车位
+// 4.手动操作修改车位状态
+// 5.临时锁定车位
+
+//车辆状态枚举
+enum Vehicle_status
+{
+    eVehicle_unknown        = 0;         //未知状态
+    eVehicle_idle           = 1;         //车辆空闲
+    eVehicle_in_garage      = 2;         //车辆已入库
+    eVehicle_parking        = 3;         //车辆停车中
+    eVehicle_fetching       = 4;         //车辆取车中
+    eVehicle_reserved       = 5;         //已预约未停入
+}
+
+//数据库状态
+enum Database_controller_status
+{
+	    E_UNKNOWN               = 0;    //默认未知
+	    E_READY               	= 1;    //正常待机
+		E_DISCONNECT			= 2;	//断连
+	    E_FAULT					= 3;	//故障
+}
+//车位管理状态
+enum Parkspace_manager_satus
+{
+    eParkspace_manager_unknown      =0;//位置
+    eParkspace_manager_normal       =1;//正常
+    eParkspace_manager_fault        =2;//故障
+};
+
+//1.分配车位请求
+message Parkspace_allocation_request_msg
+{
+    required Base_info                  base_info=1;            //消息类型
+    required string                     command_key=2;           //指令唯一标识符id
+    required Car_info                   car_info=3;
+    required int32                      terminal_id=4;          //终端id,优化车位分配用
+}
+
+//分配车位反馈
+message Parkspace_allocation_response_msg
+{
+    required Base_info                  base_info=1;            //消息类型
+    required string                     command_key=2;           //指令唯一标识符id
+    required Error_manager              error_manager=3;        //分配成功与否标志
+    repeated Parkspace_info             allocated_parkspace_info_ex = 4;    //分配车位信息
+    optional Car_type                   car_type = 5;//汽车类型
+}
+
+//2.查询车辆位置请求
+message Parkspace_search_request_msg
+{
+    required Base_info                  base_info=1;            //消息类型
+    required string                     command_key=2;           //指令唯一标识符id
+    required Car_info                   car_info=3;              //车辆凭证或号牌
+}
+
+//查询车辆位置反馈
+message Parkspace_search_response_msg
+{
+    required Base_info                  base_info=1;            //消息类型
+    required string                     command_key=2;           //指令唯一标识符id
+    required Error_manager              error_manager=3;        //分配成功与否标志
+    repeated Parkspace_info             query_parkspace_info_ex=4;         //待查询车辆存放位置
+}
+
+//3.释放车位请求
+message Parkspace_release_request_msg
+{
+    required Base_info                  base_info=1;            //消息类型
+    required string                     command_key=2;           //指令唯一标识符id
+    repeated Parkspace_info             release_parkspace_info_ex=3;   //待释放车位信息
+}
+
+//释放车位请求
+message Parkspace_release_response_msg
+{
+    required Base_info                  base_info=1;            //消息类型
+    required string                     command_key=2;           //指令唯一标识符id
+    required Error_manager              error_manager=3;        //分配成功与否标志
+    repeated Parkspace_info             release_parkspace_info_ex=4;   //待释放车位信息
+}
+
+// 4.手动操作修改车位状态
+message Parkspace_force_update_request_msg
+{
+    required Base_info                  base_info=1;            //消息类型
+    required string                     command_key=2;           //指令唯一标识符id
+    repeated Parkspace_info             manual_parkspace_info_ex=3;    //待手动修改车位信息,通过id定位
+}
+
+//手动操作反馈
+message Parkspace_force_update_response_msg
+{
+    required Base_info                  base_info=1;            //消息类型
+    required string                     command_key=2;           //指令唯一标识符id
+    required Error_manager              error_manager=3;        //分配成功与否标志
+    repeated Parkspace_info             manual_parkspace_info_ex=4;    //已修改后的车位信息
+}
+
+// 5.确认分配车位
+message Parkspace_confirm_alloc_request_msg
+{
+    required Base_info                  base_info=1;            //消息类型
+    required string                     command_key=2;           //指令唯一标识符id
+    repeated Parkspace_info             confirm_parkspace_info_ex = 3;    //分配车位信息
+    optional Car_type                   car_type = 4;//汽车类型
+
+}
+//确认分配车位反馈
+message Parkspace_confirm_alloc_response_msg
+{
+    required Base_info                  base_info=1;            //消息类型
+    required string                     command_key=2;           //指令唯一标识符id
+    required Error_manager              error_manager=3;        //分配成功与否标志
+    repeated Parkspace_info             confirm_parkspace_info_ex = 4;    //已修改后的车位信息
+    optional Car_type                   car_type = 5;//汽车类型
+
+}
+
+// 车位心跳状态信息
+message Parkspace_allocation_status_msg
+{
+    required Base_info                      base_info=1;            //消息类型
+    required Error_manager                  error_manager=2;
+    required Database_controller_status     database_controller_status=3;           //数据库的状态
+    required Parkspace_manager_satus        parkspace_manager_satus=4;              //车位管理状态
+    required int32                          small_parkspace_remaining_number=5;    //小型车位剩余数量
+    required int32                          medium_parkspace_remaining_number=6;   //中型车位剩余数量
+    required int32                          large_parkspace_remaining_number=7;    //大型车位剩余数量
+    required int32                          total_parkspace_remaining_number=8;    //所有车位剩余数量
+}
+
+//更新车位数据请求
+message Parkspace_refresh_request_msg
+{
+    required Base_info                  base_info=1;            //消息类型
+}
+// 车位数据信息
+message Parkspace_allocation_data_msg
+{
+    required Base_info                  base_info=1;            //消息类型
+    required Error_manager              error_manager=2;
+    repeated Parkspace_info             parkspace_info_ex=3;
+}

+ 1 - 0
proto.sh

@@ -9,6 +9,7 @@ protoc -I=./snap7_communication snap7_communication.proto --cpp_out=./snap7_comm
 protoc -I=./message dispatch_control.proto --cpp_out=./message
 protoc -I=./message dispatch_control.proto --cpp_out=./message
 protoc -I=./dispatch dispatch_parameter.proto --cpp_out=./dispatch
 protoc -I=./dispatch dispatch_parameter.proto --cpp_out=./dispatch
 
 
+protoc -I=./message parkspace_allocation_message.proto --cpp_out=./message