浏览代码

新增手动操作取消任务消息处理

zx 4 年之前
父节点
当前提交
892bf4e36b

+ 9 - 7
communication/communication_message.h

@@ -45,15 +45,17 @@ public:
         eParkspace_confirm_alloc_request_msg = 0x3A,//确认分配车位请求消息
         eParkspace_confirm_alloc_response_msg = 0x3B,//确认分配车位反馈消息
 
-        eStore_command_request_msg=0x41,        //终端停车请求消息
-        eStore_command_response_msg=0x42,       //停车请求反馈消息
-        ePickup_command_request_msg=0x43,       //取车请求消息
-        ePickup_command_response_msg=0x44,       //取车请求反馈消息
+        eStore_command_request_msg=0x41,                    //终端停车请求消息
+        eStore_command_response_msg=0x42,                   //停车请求反馈消息
+        ePickup_command_request_msg=0x43,                   //取车请求消息
+        ePickup_command_response_msg=0x44,                  //取车请求反馈消息
 
-        eStoring_process_statu_msg=0x90,      //停车进度条消息
-        ePicking_process_statu_msg=0x91,        //取车进度消息
+        eStoring_process_statu_msg=0x90,                    //停车进度条消息
+        ePicking_process_statu_msg=0x91,                    //取车进度消息
 
-        eCentral_controller_statu_msg=0xa0,     //中控状态消息
+        eCentral_controller_statu_msg=0xa0,                 //中控状态消息
+
+        eManual_operation_msg=0xb0,                         //中控手动操作消息
 	};
 
 //通讯单元

+ 4 - 3
error_code/error_code.h

@@ -48,10 +48,11 @@ enum Error_code
 
 
     //基本错误码,
-    ERROR                           = 0x00000001,//错误
-    PARTIAL_SUCCESS                 = 0x00000002,//部分成功
+    FAILED                          = 0x00000001,//失败
+    ERROR                           = 0x00000002,//错误
     WARNING                         = 0x00000003,//警告
-    FAILED                          = 0x00000004,//失败
+    PARTIAL_SUCCESS                 = 0x00000002,//部分成功
+
 
     NO_DATA                         = 0x00000010,//没有数据,传入参数容器内部没有数据时,
 	INVALID_MESSAGE					= 0x00000011, //无效的消息,

+ 8 - 1
main.cpp

@@ -8,6 +8,7 @@
 #include "system_communicator.h"
 #include "Locate_communicator.h"
 #include "command_manager.h"
+#include "exception_solver.h"
 #include "proto_tool.h"
 #include "pathcreator.h"
 
@@ -48,10 +49,16 @@ Error_manager init_communicators()
         return Error_manager(COMMUNICATION_READ_PROTOBUF_ERROR,MINOR_ERROR,
                              "Communication_socket_base read_proto_param  failed");
     }
+    ///初始化故障处理通讯对象
+    if(Exception_solver::get_instance_pointer()== nullptr)
+        return FAILED;
+    char bind_string[64]={0};
+    sprintf(bind_string,"tcp://%s:%d",system_setting.bind_ip().c_str(),system_setting.exception_handle_port());
+    Exception_solver::get_instance_pointer()->communication_bind(bind_string);
     ///初始化与终端通讯的对象
     if(System_communicator::get_instance_pointer()== nullptr)
         return FAILED;
-    char bind_string[64]={0};
+    memset(bind_string,0,64);
     sprintf(bind_string,"tcp://%s:%d",system_setting.bind_ip().c_str(),system_setting.terminor_port());
     System_communicator::get_instance_pointer()->communication_bind(bind_string);
 

+ 35 - 97
message/central_control_message.pb.cc

@@ -59,16 +59,14 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUT
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Central_controller_statu_msg, base_info_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Central_controller_statu_msg, paused_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Central_controller_statu_msg, entrance_statu_vector_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Central_controller_statu_msg, export_statu_vector_),
   0,
-  1,
   ~0u,
   ~0u,
 };
 static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
-  { 0, 9, sizeof(::message::Central_controller_statu_msg)},
+  { 0, 8, sizeof(::message::Central_controller_statu_msg)},
 };
 
 static ::google::protobuf::Message const * const file_default_instances[] = {
@@ -98,16 +96,16 @@ void AddDescriptorsImpl() {
   InitDefaults();
   static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
       "\n\035central_control_message.proto\022\007message"
-      "\032\022message_base.proto\"\303\001\n\034Central_control"
+      "\032\022message_base.proto\"\263\001\n\034Central_control"
       "ler_statu_msg\022%\n\tbase_info\030\001 \002(\0132\022.messa"
-      "ge.Base_info\022\016\n\006paused\030\002 \002(\010\0226\n\025entrance"
-      "_statu_vector\030\003 \003(\0162\027.message.Entrance_s"
-      "tatu\0224\n\023export_statu_vector\030\004 \003(\0162\027.mess"
-      "age.Entrance_statu*+\n\016Entrance_statu\022\013\n\007"
-      "eEnable\020\000\022\014\n\010eDisable\020\001"
+      "ge.Base_info\0226\n\025entrance_statu_vector\030\002 "
+      "\003(\0162\027.message.Entrance_statu\0224\n\023export_s"
+      "tatu_vector\030\003 \003(\0162\027.message.Entrance_sta"
+      "tu*8\n\016Entrance_statu\022\013\n\007eEnable\020\000\022\014\n\010eDi"
+      "sable\020\001\022\013\n\007ePaused\020\002"
   };
   ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
-      descriptor, 303);
+      descriptor, 300);
   ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
     "central_control_message.proto", &protobuf_RegisterTypes);
   ::protobuf_message_5fbase_2eproto::AddDescriptors();
@@ -133,6 +131,7 @@ bool Entrance_statu_IsValid(int value) {
   switch (value) {
     case 0:
     case 1:
+    case 2:
       return true;
     default:
       return false;
@@ -152,7 +151,6 @@ void Central_controller_statu_msg::clear_base_info() {
 }
 #if !defined(_MSC_VER) || _MSC_VER >= 1900
 const int Central_controller_statu_msg::kBaseInfoFieldNumber;
-const int Central_controller_statu_msg::kPausedFieldNumber;
 const int Central_controller_statu_msg::kEntranceStatuVectorFieldNumber;
 const int Central_controller_statu_msg::kExportStatuVectorFieldNumber;
 #endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
@@ -178,15 +176,12 @@ Central_controller_statu_msg::Central_controller_statu_msg(const Central_control
   } else {
     base_info_ = NULL;
   }
-  paused_ = from.paused_;
   // @@protoc_insertion_point(copy_constructor:message.Central_controller_statu_msg)
 }
 
 void Central_controller_statu_msg::SharedCtor() {
   _cached_size_ = 0;
-  ::memset(&base_info_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&paused_) -
-      reinterpret_cast<char*>(&base_info_)) + sizeof(paused_));
+  base_info_ = NULL;
 }
 
 Central_controller_statu_msg::~Central_controller_statu_msg() {
@@ -234,7 +229,6 @@ void Central_controller_statu_msg::Clear() {
     GOOGLE_DCHECK(base_info_ != NULL);
     base_info_->Clear();
   }
-  paused_ = false;
   _has_bits_.Clear();
   _internal_metadata_.Clear();
 }
@@ -261,24 +255,10 @@ bool Central_controller_statu_msg::MergePartialFromCodedStream(
         break;
       }
 
-      // required bool paused = 2;
+      // repeated .message.Entrance_statu entrance_statu_vector = 2;
       case 2: {
         if (static_cast< ::google::protobuf::uint8>(tag) ==
             static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          set_has_paused();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &paused_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // repeated .message.Entrance_statu entrance_statu_vector = 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>(
@@ -287,14 +267,14 @@ bool Central_controller_statu_msg::MergePartialFromCodedStream(
             add_entrance_statu_vector(static_cast< ::message::Entrance_statu >(value));
           } else {
             mutable_unknown_fields()->AddVarint(
-                3, static_cast< ::google::protobuf::uint64>(value));
+                2, static_cast< ::google::protobuf::uint64>(value));
           }
         } else if (
             static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
+            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
           DO_((::google::protobuf::internal::WireFormat::ReadPackedEnumPreserveUnknowns(
                  input,
-                 3,
+                 2,
                  ::message::Entrance_statu_IsValid,
                  mutable_unknown_fields(),
                  this->mutable_entrance_statu_vector())));
@@ -304,10 +284,10 @@ bool Central_controller_statu_msg::MergePartialFromCodedStream(
         break;
       }
 
-      // repeated .message.Entrance_statu export_statu_vector = 4;
-      case 4: {
+      // repeated .message.Entrance_statu export_statu_vector = 3;
+      case 3: {
         if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
+            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
           int value;
           DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                    int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
@@ -316,14 +296,14 @@ bool Central_controller_statu_msg::MergePartialFromCodedStream(
             add_export_statu_vector(static_cast< ::message::Entrance_statu >(value));
           } else {
             mutable_unknown_fields()->AddVarint(
-                4, static_cast< ::google::protobuf::uint64>(value));
+                3, static_cast< ::google::protobuf::uint64>(value));
           }
         } else if (
             static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
+            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
           DO_((::google::protobuf::internal::WireFormat::ReadPackedEnumPreserveUnknowns(
                  input,
-                 4,
+                 3,
                  ::message::Entrance_statu_IsValid,
                  mutable_unknown_fields(),
                  this->mutable_export_statu_vector())));
@@ -366,21 +346,16 @@ void Central_controller_statu_msg::SerializeWithCachedSizes(
       1, *this->base_info_, output);
   }
 
-  // required bool paused = 2;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->paused(), output);
-  }
-
-  // repeated .message.Entrance_statu entrance_statu_vector = 3;
+  // repeated .message.Entrance_statu entrance_statu_vector = 2;
   for (int i = 0, n = this->entrance_statu_vector_size(); i < n; i++) {
     ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      3, this->entrance_statu_vector(i), output);
+      2, this->entrance_statu_vector(i), output);
   }
 
-  // repeated .message.Entrance_statu export_statu_vector = 4;
+  // repeated .message.Entrance_statu export_statu_vector = 3;
   for (int i = 0, n = this->export_statu_vector_size(); i < n; i++) {
     ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      4, this->export_statu_vector(i), output);
+      3, this->export_statu_vector(i), output);
   }
 
   if (_internal_metadata_.have_unknown_fields()) {
@@ -405,18 +380,13 @@ void Central_controller_statu_msg::SerializeWithCachedSizes(
         1, *this->base_info_, deterministic, target);
   }
 
-  // required bool paused = 2;
-  if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->paused(), target);
-  }
-
-  // repeated .message.Entrance_statu entrance_statu_vector = 3;
+  // repeated .message.Entrance_statu entrance_statu_vector = 2;
   target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-    3, this->entrance_statu_vector_, target);
+    2, this->entrance_statu_vector_, target);
 
-  // repeated .message.Entrance_statu export_statu_vector = 4;
+  // repeated .message.Entrance_statu export_statu_vector = 3;
   target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-    4, this->export_statu_vector_, target);
+    3, this->export_statu_vector_, target);
 
   if (_internal_metadata_.have_unknown_fields()) {
     target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
@@ -426,24 +396,6 @@ void Central_controller_statu_msg::SerializeWithCachedSizes(
   return target;
 }
 
-size_t Central_controller_statu_msg::RequiredFieldsByteSizeFallback() const {
-// @@protoc_insertion_point(required_fields_byte_size_fallback_start:message.Central_controller_statu_msg)
-  size_t total_size = 0;
-
-  if (has_base_info()) {
-    // required .message.Base_info base_info = 1;
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::MessageSize(
-        *this->base_info_);
-  }
-
-  if (has_paused()) {
-    // required bool paused = 2;
-    total_size += 1 + 1;
-  }
-
-  return total_size;
-}
 size_t Central_controller_statu_msg::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:message.Central_controller_statu_msg)
   size_t total_size = 0;
@@ -453,19 +405,13 @@ size_t Central_controller_statu_msg::ByteSizeLong() const {
       ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
         _internal_metadata_.unknown_fields());
   }
-  if (((_has_bits_[0] & 0x00000003) ^ 0x00000003) == 0) {  // All required fields are present.
-    // required .message.Base_info base_info = 1;
+  // required .message.Base_info base_info = 1;
+  if (has_base_info()) {
     total_size += 1 +
       ::google::protobuf::internal::WireFormatLite::MessageSize(
         *this->base_info_);
-
-    // required bool paused = 2;
-    total_size += 1 + 1;
-
-  } else {
-    total_size += RequiredFieldsByteSizeFallback();
   }
-  // repeated .message.Entrance_statu entrance_statu_vector = 3;
+  // repeated .message.Entrance_statu entrance_statu_vector = 2;
   {
     size_t data_size = 0;
     unsigned int count = static_cast<unsigned int>(this->entrance_statu_vector_size());for (unsigned int i = 0; i < count; i++) {
@@ -475,7 +421,7 @@ size_t Central_controller_statu_msg::ByteSizeLong() const {
     total_size += (1UL * count) + data_size;
   }
 
-  // repeated .message.Entrance_statu export_statu_vector = 4;
+  // repeated .message.Entrance_statu export_statu_vector = 3;
   {
     size_t data_size = 0;
     unsigned int count = static_cast<unsigned int>(this->export_statu_vector_size());for (unsigned int i = 0; i < count; i++) {
@@ -516,15 +462,8 @@ void Central_controller_statu_msg::MergeFrom(const Central_controller_statu_msg&
 
   entrance_statu_vector_.MergeFrom(from.entrance_statu_vector_);
   export_statu_vector_.MergeFrom(from.export_statu_vector_);
-  cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 3u) {
-    if (cached_has_bits & 0x00000001u) {
-      mutable_base_info()->::message::Base_info::MergeFrom(from.base_info());
-    }
-    if (cached_has_bits & 0x00000002u) {
-      paused_ = from.paused_;
-    }
-    _has_bits_[0] |= cached_has_bits;
+  if (from.has_base_info()) {
+    mutable_base_info()->::message::Base_info::MergeFrom(from.base_info());
   }
 }
 
@@ -543,7 +482,7 @@ void Central_controller_statu_msg::CopyFrom(const Central_controller_statu_msg&
 }
 
 bool Central_controller_statu_msg::IsInitialized() const {
-  if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;
+  if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
   if (has_base_info()) {
     if (!this->base_info_->IsInitialized()) return false;
   }
@@ -559,7 +498,6 @@ void Central_controller_statu_msg::InternalSwap(Central_controller_statu_msg* ot
   entrance_statu_vector_.InternalSwap(&other->entrance_statu_vector_);
   export_statu_vector_.InternalSwap(&other->export_statu_vector_);
   swap(base_info_, other->base_info_);
-  swap(paused_, other->paused_);
   swap(_has_bits_[0], other->_has_bits_[0]);
   _internal_metadata_.Swap(&other->_internal_metadata_);
   swap(_cached_size_, other->_cached_size_);

+ 9 - 45
message/central_control_message.pb.h

@@ -59,11 +59,12 @@ namespace message {
 
 enum Entrance_statu {
   eEnable = 0,
-  eDisable = 1
+  eDisable = 1,
+  ePaused = 2
 };
 bool Entrance_statu_IsValid(int value);
 const Entrance_statu Entrance_statu_MIN = eEnable;
-const Entrance_statu Entrance_statu_MAX = eDisable;
+const Entrance_statu Entrance_statu_MAX = ePaused;
 const int Entrance_statu_ARRAYSIZE = Entrance_statu_MAX + 1;
 
 const ::google::protobuf::EnumDescriptor* Entrance_statu_descriptor();
@@ -167,20 +168,20 @@ class Central_controller_statu_msg : public ::google::protobuf::Message /* @@pro
 
   // accessors -------------------------------------------------------
 
-  // repeated .message.Entrance_statu entrance_statu_vector = 3;
+  // repeated .message.Entrance_statu entrance_statu_vector = 2;
   int entrance_statu_vector_size() const;
   void clear_entrance_statu_vector();
-  static const int kEntranceStatuVectorFieldNumber = 3;
+  static const int kEntranceStatuVectorFieldNumber = 2;
   ::message::Entrance_statu entrance_statu_vector(int index) const;
   void set_entrance_statu_vector(int index, ::message::Entrance_statu value);
   void add_entrance_statu_vector(::message::Entrance_statu value);
   const ::google::protobuf::RepeatedField<int>& entrance_statu_vector() const;
   ::google::protobuf::RepeatedField<int>* mutable_entrance_statu_vector();
 
-  // repeated .message.Entrance_statu export_statu_vector = 4;
+  // repeated .message.Entrance_statu export_statu_vector = 3;
   int export_statu_vector_size() const;
   void clear_export_statu_vector();
-  static const int kExportStatuVectorFieldNumber = 4;
+  static const int kExportStatuVectorFieldNumber = 3;
   ::message::Entrance_statu export_statu_vector(int index) const;
   void set_export_statu_vector(int index, ::message::Entrance_statu value);
   void add_export_statu_vector(::message::Entrance_statu value);
@@ -196,22 +197,10 @@ class Central_controller_statu_msg : public ::google::protobuf::Message /* @@pro
   ::message::Base_info* mutable_base_info();
   void set_allocated_base_info(::message::Base_info* base_info);
 
-  // required bool paused = 2;
-  bool has_paused() const;
-  void clear_paused();
-  static const int kPausedFieldNumber = 2;
-  bool paused() const;
-  void set_paused(bool value);
-
   // @@protoc_insertion_point(class_scope:message.Central_controller_statu_msg)
  private:
   void set_has_base_info();
   void clear_has_base_info();
-  void set_has_paused();
-  void clear_has_paused();
-
-  // helper for ByteSizeLong()
-  size_t RequiredFieldsByteSizeFallback() const;
 
   ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
   ::google::protobuf::internal::HasBits<1> _has_bits_;
@@ -219,7 +208,6 @@ class Central_controller_statu_msg : public ::google::protobuf::Message /* @@pro
   ::google::protobuf::RepeatedField<int> entrance_statu_vector_;
   ::google::protobuf::RepeatedField<int> export_statu_vector_;
   ::message::Base_info* base_info_;
-  bool paused_;
   friend struct ::protobuf_central_5fcontrol_5fmessage_2eproto::TableStruct;
   friend void ::protobuf_central_5fcontrol_5fmessage_2eproto::InitDefaultsCentral_controller_statu_msgImpl();
 };
@@ -284,31 +272,7 @@ inline void Central_controller_statu_msg::set_allocated_base_info(::message::Bas
   // @@protoc_insertion_point(field_set_allocated:message.Central_controller_statu_msg.base_info)
 }
 
-// required bool paused = 2;
-inline bool Central_controller_statu_msg::has_paused() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void Central_controller_statu_msg::set_has_paused() {
-  _has_bits_[0] |= 0x00000002u;
-}
-inline void Central_controller_statu_msg::clear_has_paused() {
-  _has_bits_[0] &= ~0x00000002u;
-}
-inline void Central_controller_statu_msg::clear_paused() {
-  paused_ = false;
-  clear_has_paused();
-}
-inline bool Central_controller_statu_msg::paused() const {
-  // @@protoc_insertion_point(field_get:message.Central_controller_statu_msg.paused)
-  return paused_;
-}
-inline void Central_controller_statu_msg::set_paused(bool value) {
-  set_has_paused();
-  paused_ = value;
-  // @@protoc_insertion_point(field_set:message.Central_controller_statu_msg.paused)
-}
-
-// repeated .message.Entrance_statu entrance_statu_vector = 3;
+// repeated .message.Entrance_statu entrance_statu_vector = 2;
 inline int Central_controller_statu_msg::entrance_statu_vector_size() const {
   return entrance_statu_vector_.size();
 }
@@ -340,7 +304,7 @@ Central_controller_statu_msg::mutable_entrance_statu_vector() {
   return &entrance_statu_vector_;
 }
 
-// repeated .message.Entrance_statu export_statu_vector = 4;
+// repeated .message.Entrance_statu export_statu_vector = 3;
 inline int Central_controller_statu_msg::export_statu_vector_size() const {
   return export_statu_vector_.size();
 }

+ 3 - 3
message/central_control_message.proto

@@ -7,14 +7,14 @@ enum Entrance_statu
 {
     eEnable=0;                          //出入口关闭
     eDisable=1;                         //出入口开放
+    ePaused=2;                          //急停
 }
 
 //中控状态消息
 message Central_controller_statu_msg
 {
     required Base_info                  base_info=1;                 //消息类型
-    required bool                       paused=2;
-    repeated Entrance_statu             entrance_statu_vector=3;    //入口状态(关闭或者开放)
-    repeated Entrance_statu             export_statu_vector=4;      //出口状态
+    repeated Entrance_statu             entrance_statu_vector=2;    //入口状态(关闭或者开放)
+    repeated Entrance_statu             export_statu_vector=3;      //出口状态
 }
 

+ 628 - 0
message/manual_operation_message.pb.cc

@@ -0,0 +1,628 @@
+// Generated by the protocol buffer compiler.  DO NOT EDIT!
+// source: manual_operation_message.proto
+
+#include "manual_operation_message.pb.h"
+
+#include <algorithm>
+
+#include <google/protobuf/stubs/common.h>
+#include <google/protobuf/stubs/port.h>
+#include <google/protobuf/stubs/once.h>
+#include <google/protobuf/io/coded_stream.h>
+#include <google/protobuf/wire_format_lite_inl.h>
+#include <google/protobuf/descriptor.h>
+#include <google/protobuf/generated_message_reflection.h>
+#include <google/protobuf/reflection_ops.h>
+#include <google/protobuf/wire_format.h>
+// This is a temporary google only hack
+#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
+#include "third_party/protobuf/version.h"
+#endif
+// @@protoc_insertion_point(includes)
+namespace message {
+class Manual_operation_msgDefaultTypeInternal {
+ public:
+  ::google::protobuf::internal::ExplicitlyConstructed<Manual_operation_msg>
+      _instance;
+} _Manual_operation_msg_default_instance_;
+}  // namespace message
+namespace protobuf_manual_5foperation_5fmessage_2eproto {
+void InitDefaultsManual_operation_msgImpl() {
+  GOOGLE_PROTOBUF_VERIFY_VERSION;
+
+#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
+  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
+#else
+  ::google::protobuf::internal::InitProtobufDefaults();
+#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
+  protobuf_message_5fbase_2eproto::InitDefaultsBase_info();
+  {
+    void* ptr = &::message::_Manual_operation_msg_default_instance_;
+    new (ptr) ::message::Manual_operation_msg();
+    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
+  }
+  ::message::Manual_operation_msg::InitAsDefaultInstance();
+}
+
+void InitDefaultsManual_operation_msg() {
+  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
+  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsManual_operation_msgImpl);
+}
+
+::google::protobuf::Metadata file_level_metadata[1];
+const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[2];
+
+const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Manual_operation_msg, _has_bits_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Manual_operation_msg, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Manual_operation_msg, base_info_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Manual_operation_msg, license_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Manual_operation_msg, step_type_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Manual_operation_msg, operate_type_),
+  1,
+  0,
+  2,
+  3,
+};
+static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
+  { 0, 9, sizeof(::message::Manual_operation_msg)},
+};
+
+static ::google::protobuf::Message const * const file_default_instances[] = {
+  reinterpret_cast<const ::google::protobuf::Message*>(&::message::_Manual_operation_msg_default_instance_),
+};
+
+void protobuf_AssignDescriptors() {
+  AddDescriptors();
+  ::google::protobuf::MessageFactory* factory = NULL;
+  AssignDescriptors(
+      "manual_operation_message.proto", schemas, file_default_instances, TableStruct::offsets, factory,
+      file_level_metadata, file_level_enum_descriptors, NULL);
+}
+
+void protobuf_AssignDescriptorsOnce() {
+  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
+  ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors);
+}
+
+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, 1);
+}
+
+void AddDescriptorsImpl() {
+  InitDefaults();
+  static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
+      "\n\036manual_operation_message.proto\022\007messag"
+      "e\032\022message_base.proto\"\244\001\n\024Manual_operati"
+      "on_msg\022%\n\tbase_info\030\001 \002(\0132\022.message.Base"
+      "_info\022\017\n\007license\030\002 \002(\t\022%\n\tstep_type\030\003 \002("
+      "\0162\022.message.Step_type\022-\n\014operate_type\030\004 "
+      "\002(\0162\027.message.Operation_type*\376\001\n\tStep_ty"
+      "pe\022\017\n\013eAlloc_step\020\000\022\021\n\reMeasure_step\020\001\022\021"
+      "\n\reCompare_step\020\002\022\022\n\016eDispatch_step\020\003\022\021\n"
+      "\reConfirm_step\020\004\022\r\n\teComplete\020\005\022\025\n\021eBack"
+      "Confirm_step\020\006\022\026\n\022eBackDispatch_step\020\007\022\026"
+      "\n\022eBack_compare_step\020\010\022\025\n\021eBackMeasure_s"
+      "tep\020\t\022\023\n\017eBackAlloc_step\020\n\022\021\n\reBackCompl"
+      "ete\020\013*$\n\016Operation_type\022\022\n\016eManual_cance"
+      "l\020\001"
+  };
+  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
+      descriptor, 523);
+  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
+    "manual_operation_message.proto", &protobuf_RegisterTypes);
+  ::protobuf_message_5fbase_2eproto::AddDescriptors();
+}
+
+void AddDescriptors() {
+  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
+  ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
+}
+// Force AddDescriptors() to be called at dynamic initialization time.
+struct StaticDescriptorInitializer {
+  StaticDescriptorInitializer() {
+    AddDescriptors();
+  }
+} static_descriptor_initializer;
+}  // namespace protobuf_manual_5foperation_5fmessage_2eproto
+namespace message {
+const ::google::protobuf::EnumDescriptor* Step_type_descriptor() {
+  protobuf_manual_5foperation_5fmessage_2eproto::protobuf_AssignDescriptorsOnce();
+  return protobuf_manual_5foperation_5fmessage_2eproto::file_level_enum_descriptors[0];
+}
+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:
+      return true;
+    default:
+      return false;
+  }
+}
+
+const ::google::protobuf::EnumDescriptor* Operation_type_descriptor() {
+  protobuf_manual_5foperation_5fmessage_2eproto::protobuf_AssignDescriptorsOnce();
+  return protobuf_manual_5foperation_5fmessage_2eproto::file_level_enum_descriptors[1];
+}
+bool Operation_type_IsValid(int value) {
+  switch (value) {
+    case 1:
+      return true;
+    default:
+      return false;
+  }
+}
+
+
+// ===================================================================
+
+void Manual_operation_msg::InitAsDefaultInstance() {
+  ::message::_Manual_operation_msg_default_instance_._instance.get_mutable()->base_info_ = const_cast< ::message::Base_info*>(
+      ::message::Base_info::internal_default_instance());
+}
+void Manual_operation_msg::clear_base_info() {
+  if (base_info_ != NULL) base_info_->Clear();
+  clear_has_base_info();
+}
+#if !defined(_MSC_VER) || _MSC_VER >= 1900
+const int Manual_operation_msg::kBaseInfoFieldNumber;
+const int Manual_operation_msg::kLicenseFieldNumber;
+const int Manual_operation_msg::kStepTypeFieldNumber;
+const int Manual_operation_msg::kOperateTypeFieldNumber;
+#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
+
+Manual_operation_msg::Manual_operation_msg()
+  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
+  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
+    ::protobuf_manual_5foperation_5fmessage_2eproto::InitDefaultsManual_operation_msg();
+  }
+  SharedCtor();
+  // @@protoc_insertion_point(constructor:message.Manual_operation_msg)
+}
+Manual_operation_msg::Manual_operation_msg(const Manual_operation_msg& from)
+  : ::google::protobuf::Message(),
+      _internal_metadata_(NULL),
+      _has_bits_(from._has_bits_),
+      _cached_size_(0) {
+  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  license_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (from.has_license()) {
+    license_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.license_);
+  }
+  if (from.has_base_info()) {
+    base_info_ = new ::message::Base_info(*from.base_info_);
+  } else {
+    base_info_ = NULL;
+  }
+  ::memcpy(&step_type_, &from.step_type_,
+    static_cast<size_t>(reinterpret_cast<char*>(&operate_type_) -
+    reinterpret_cast<char*>(&step_type_)) + sizeof(operate_type_));
+  // @@protoc_insertion_point(copy_constructor:message.Manual_operation_msg)
+}
+
+void Manual_operation_msg::SharedCtor() {
+  _cached_size_ = 0;
+  license_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  ::memset(&base_info_, 0, static_cast<size_t>(
+      reinterpret_cast<char*>(&step_type_) -
+      reinterpret_cast<char*>(&base_info_)) + sizeof(step_type_));
+  operate_type_ = 1;
+}
+
+Manual_operation_msg::~Manual_operation_msg() {
+  // @@protoc_insertion_point(destructor:message.Manual_operation_msg)
+  SharedDtor();
+}
+
+void Manual_operation_msg::SharedDtor() {
+  license_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (this != internal_default_instance()) delete base_info_;
+}
+
+void Manual_operation_msg::SetCachedSize(int size) const {
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+}
+const ::google::protobuf::Descriptor* Manual_operation_msg::descriptor() {
+  ::protobuf_manual_5foperation_5fmessage_2eproto::protobuf_AssignDescriptorsOnce();
+  return ::protobuf_manual_5foperation_5fmessage_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+}
+
+const Manual_operation_msg& Manual_operation_msg::default_instance() {
+  ::protobuf_manual_5foperation_5fmessage_2eproto::InitDefaultsManual_operation_msg();
+  return *internal_default_instance();
+}
+
+Manual_operation_msg* Manual_operation_msg::New(::google::protobuf::Arena* arena) const {
+  Manual_operation_msg* n = new Manual_operation_msg;
+  if (arena != NULL) {
+    arena->Own(n);
+  }
+  return n;
+}
+
+void Manual_operation_msg::Clear() {
+// @@protoc_insertion_point(message_clear_start:message.Manual_operation_msg)
+  ::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 & 3u) {
+    if (cached_has_bits & 0x00000001u) {
+      GOOGLE_DCHECK(!license_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
+      (*license_.UnsafeRawStringPointer())->clear();
+    }
+    if (cached_has_bits & 0x00000002u) {
+      GOOGLE_DCHECK(base_info_ != NULL);
+      base_info_->Clear();
+    }
+  }
+  if (cached_has_bits & 12u) {
+    step_type_ = 0;
+    operate_type_ = 1;
+  }
+  _has_bits_.Clear();
+  _internal_metadata_.Clear();
+}
+
+bool Manual_operation_msg::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.Manual_operation_msg)
+  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 .message.Base_info base_info = 1;
+      case 1: {
+        if (static_cast< ::google::protobuf::uint8>(tag) ==
+            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
+          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
+               input, mutable_base_info()));
+        } else {
+          goto handle_unusual;
+        }
+        break;
+      }
+
+      // required string license = 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_license()));
+          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
+            this->license().data(), static_cast<int>(this->license().length()),
+            ::google::protobuf::internal::WireFormat::PARSE,
+            "message.Manual_operation_msg.license");
+        } else {
+          goto handle_unusual;
+        }
+        break;
+      }
+
+      // required .message.Step_type step_type = 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::Step_type_IsValid(value)) {
+            set_step_type(static_cast< ::message::Step_type >(value));
+          } else {
+            mutable_unknown_fields()->AddVarint(
+                3, static_cast< ::google::protobuf::uint64>(value));
+          }
+        } else {
+          goto handle_unusual;
+        }
+        break;
+      }
+
+      // required .message.Operation_type operate_type = 4;
+      case 4: {
+        if (static_cast< ::google::protobuf::uint8>(tag) ==
+            static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
+          int value;
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
+                 input, &value)));
+          if (::message::Operation_type_IsValid(value)) {
+            set_operate_type(static_cast< ::message::Operation_type >(value));
+          } else {
+            mutable_unknown_fields()->AddVarint(
+                4, 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.Manual_operation_msg)
+  return true;
+failure:
+  // @@protoc_insertion_point(parse_failure:message.Manual_operation_msg)
+  return false;
+#undef DO_
+}
+
+void Manual_operation_msg::SerializeWithCachedSizes(
+    ::google::protobuf::io::CodedOutputStream* output) const {
+  // @@protoc_insertion_point(serialize_start:message.Manual_operation_msg)
+  ::google::protobuf::uint32 cached_has_bits = 0;
+  (void) cached_has_bits;
+
+  cached_has_bits = _has_bits_[0];
+  // required .message.Base_info base_info = 1;
+  if (cached_has_bits & 0x00000002u) {
+    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
+      1, *this->base_info_, output);
+  }
+
+  // required string license = 2;
+  if (cached_has_bits & 0x00000001u) {
+    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->license().data(), static_cast<int>(this->license().length()),
+      ::google::protobuf::internal::WireFormat::SERIALIZE,
+      "message.Manual_operation_msg.license");
+    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
+      2, this->license(), output);
+  }
+
+  // required .message.Step_type step_type = 3;
+  if (cached_has_bits & 0x00000004u) {
+    ::google::protobuf::internal::WireFormatLite::WriteEnum(
+      3, this->step_type(), output);
+  }
+
+  // required .message.Operation_type operate_type = 4;
+  if (cached_has_bits & 0x00000008u) {
+    ::google::protobuf::internal::WireFormatLite::WriteEnum(
+      4, this->operate_type(), output);
+  }
+
+  if (_internal_metadata_.have_unknown_fields()) {
+    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
+        _internal_metadata_.unknown_fields(), output);
+  }
+  // @@protoc_insertion_point(serialize_end:message.Manual_operation_msg)
+}
+
+::google::protobuf::uint8* Manual_operation_msg::InternalSerializeWithCachedSizesToArray(
+    bool deterministic, ::google::protobuf::uint8* target) const {
+  (void)deterministic; // Unused
+  // @@protoc_insertion_point(serialize_to_array_start:message.Manual_operation_msg)
+  ::google::protobuf::uint32 cached_has_bits = 0;
+  (void) cached_has_bits;
+
+  cached_has_bits = _has_bits_[0];
+  // required .message.Base_info base_info = 1;
+  if (cached_has_bits & 0x00000002u) {
+    target = ::google::protobuf::internal::WireFormatLite::
+      InternalWriteMessageToArray(
+        1, *this->base_info_, deterministic, target);
+  }
+
+  // required string license = 2;
+  if (cached_has_bits & 0x00000001u) {
+    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->license().data(), static_cast<int>(this->license().length()),
+      ::google::protobuf::internal::WireFormat::SERIALIZE,
+      "message.Manual_operation_msg.license");
+    target =
+      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
+        2, this->license(), target);
+  }
+
+  // required .message.Step_type step_type = 3;
+  if (cached_has_bits & 0x00000004u) {
+    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
+      3, this->step_type(), target);
+  }
+
+  // required .message.Operation_type operate_type = 4;
+  if (cached_has_bits & 0x00000008u) {
+    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
+      4, this->operate_type(), 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.Manual_operation_msg)
+  return target;
+}
+
+size_t Manual_operation_msg::RequiredFieldsByteSizeFallback() const {
+// @@protoc_insertion_point(required_fields_byte_size_fallback_start:message.Manual_operation_msg)
+  size_t total_size = 0;
+
+  if (has_license()) {
+    // required string license = 2;
+    total_size += 1 +
+      ::google::protobuf::internal::WireFormatLite::StringSize(
+        this->license());
+  }
+
+  if (has_base_info()) {
+    // required .message.Base_info base_info = 1;
+    total_size += 1 +
+      ::google::protobuf::internal::WireFormatLite::MessageSize(
+        *this->base_info_);
+  }
+
+  if (has_step_type()) {
+    // required .message.Step_type step_type = 3;
+    total_size += 1 +
+      ::google::protobuf::internal::WireFormatLite::EnumSize(this->step_type());
+  }
+
+  if (has_operate_type()) {
+    // required .message.Operation_type operate_type = 4;
+    total_size += 1 +
+      ::google::protobuf::internal::WireFormatLite::EnumSize(this->operate_type());
+  }
+
+  return total_size;
+}
+size_t Manual_operation_msg::ByteSizeLong() const {
+// @@protoc_insertion_point(message_byte_size_start:message.Manual_operation_msg)
+  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] & 0x0000000f) ^ 0x0000000f) == 0) {  // All required fields are present.
+    // required string license = 2;
+    total_size += 1 +
+      ::google::protobuf::internal::WireFormatLite::StringSize(
+        this->license());
+
+    // required .message.Base_info base_info = 1;
+    total_size += 1 +
+      ::google::protobuf::internal::WireFormatLite::MessageSize(
+        *this->base_info_);
+
+    // required .message.Step_type step_type = 3;
+    total_size += 1 +
+      ::google::protobuf::internal::WireFormatLite::EnumSize(this->step_type());
+
+    // required .message.Operation_type operate_type = 4;
+    total_size += 1 +
+      ::google::protobuf::internal::WireFormatLite::EnumSize(this->operate_type());
+
+  } 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 Manual_operation_msg::MergeFrom(const ::google::protobuf::Message& from) {
+// @@protoc_insertion_point(generalized_merge_from_start:message.Manual_operation_msg)
+  GOOGLE_DCHECK_NE(&from, this);
+  const Manual_operation_msg* source =
+      ::google::protobuf::internal::DynamicCastToGenerated<const Manual_operation_msg>(
+          &from);
+  if (source == NULL) {
+  // @@protoc_insertion_point(generalized_merge_from_cast_fail:message.Manual_operation_msg)
+    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
+  } else {
+  // @@protoc_insertion_point(generalized_merge_from_cast_success:message.Manual_operation_msg)
+    MergeFrom(*source);
+  }
+}
+
+void Manual_operation_msg::MergeFrom(const Manual_operation_msg& from) {
+// @@protoc_insertion_point(class_specific_merge_from_start:message.Manual_operation_msg)
+  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 & 15u) {
+    if (cached_has_bits & 0x00000001u) {
+      set_has_license();
+      license_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.license_);
+    }
+    if (cached_has_bits & 0x00000002u) {
+      mutable_base_info()->::message::Base_info::MergeFrom(from.base_info());
+    }
+    if (cached_has_bits & 0x00000004u) {
+      step_type_ = from.step_type_;
+    }
+    if (cached_has_bits & 0x00000008u) {
+      operate_type_ = from.operate_type_;
+    }
+    _has_bits_[0] |= cached_has_bits;
+  }
+}
+
+void Manual_operation_msg::CopyFrom(const ::google::protobuf::Message& from) {
+// @@protoc_insertion_point(generalized_copy_from_start:message.Manual_operation_msg)
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+void Manual_operation_msg::CopyFrom(const Manual_operation_msg& from) {
+// @@protoc_insertion_point(class_specific_copy_from_start:message.Manual_operation_msg)
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+bool Manual_operation_msg::IsInitialized() const {
+  if ((_has_bits_[0] & 0x0000000f) != 0x0000000f) return false;
+  if (has_base_info()) {
+    if (!this->base_info_->IsInitialized()) return false;
+  }
+  return true;
+}
+
+void Manual_operation_msg::Swap(Manual_operation_msg* other) {
+  if (other == this) return;
+  InternalSwap(other);
+}
+void Manual_operation_msg::InternalSwap(Manual_operation_msg* other) {
+  using std::swap;
+  license_.Swap(&other->license_);
+  swap(base_info_, other->base_info_);
+  swap(step_type_, other->step_type_);
+  swap(operate_type_, other->operate_type_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
+  _internal_metadata_.Swap(&other->_internal_metadata_);
+  swap(_cached_size_, other->_cached_size_);
+}
+
+::google::protobuf::Metadata Manual_operation_msg::GetMetadata() const {
+  protobuf_manual_5foperation_5fmessage_2eproto::protobuf_AssignDescriptorsOnce();
+  return ::protobuf_manual_5foperation_5fmessage_2eproto::file_level_metadata[kIndexInFileMessages];
+}
+
+
+// @@protoc_insertion_point(namespace_scope)
+}  // namespace message
+
+// @@protoc_insertion_point(global_scope)

+ 461 - 0
message/manual_operation_message.pb.h

@@ -0,0 +1,461 @@
+// Generated by the protocol buffer compiler.  DO NOT EDIT!
+// source: manual_operation_message.proto
+
+#ifndef PROTOBUF_manual_5foperation_5fmessage_2eproto__INCLUDED
+#define PROTOBUF_manual_5foperation_5fmessage_2eproto__INCLUDED
+
+#include <string>
+
+#include <google/protobuf/stubs/common.h>
+
+#if GOOGLE_PROTOBUF_VERSION < 3005000
+#error This file was generated by a newer version of protoc which is
+#error incompatible with your Protocol Buffer headers.  Please update
+#error your headers.
+#endif
+#if 3005000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
+#error This file was generated by an older version of protoc which is
+#error incompatible with your Protocol Buffer headers.  Please
+#error regenerate this file with a newer version of protoc.
+#endif
+
+#include <google/protobuf/io/coded_stream.h>
+#include <google/protobuf/arena.h>
+#include <google/protobuf/arenastring.h>
+#include <google/protobuf/generated_message_table_driven.h>
+#include <google/protobuf/generated_message_util.h>
+#include <google/protobuf/metadata.h>
+#include <google/protobuf/message.h>
+#include <google/protobuf/repeated_field.h>  // IWYU pragma: export
+#include <google/protobuf/extension_set.h>  // IWYU pragma: export
+#include <google/protobuf/generated_enum_reflection.h>
+#include <google/protobuf/unknown_field_set.h>
+#include "message_base.pb.h"
+// @@protoc_insertion_point(includes)
+
+namespace protobuf_manual_5foperation_5fmessage_2eproto {
+// Internal implementation detail -- do not use these members.
+struct TableStruct {
+  static const ::google::protobuf::internal::ParseTableField entries[];
+  static const ::google::protobuf::internal::AuxillaryParseTableField aux[];
+  static const ::google::protobuf::internal::ParseTable schema[1];
+  static const ::google::protobuf::internal::FieldMetadata field_metadata[];
+  static const ::google::protobuf::internal::SerializationTable serialization_table[];
+  static const ::google::protobuf::uint32 offsets[];
+};
+void AddDescriptors();
+void InitDefaultsManual_operation_msgImpl();
+void InitDefaultsManual_operation_msg();
+inline void InitDefaults() {
+  InitDefaultsManual_operation_msg();
+}
+}  // namespace protobuf_manual_5foperation_5fmessage_2eproto
+namespace message {
+class Manual_operation_msg;
+class Manual_operation_msgDefaultTypeInternal;
+extern Manual_operation_msgDefaultTypeInternal _Manual_operation_msg_default_instance_;
+}  // namespace message
+namespace message {
+
+enum Step_type {
+  eAlloc_step = 0,
+  eMeasure_step = 1,
+  eCompare_step = 2,
+  eDispatch_step = 3,
+  eConfirm_step = 4,
+  eComplete = 5,
+  eBackConfirm_step = 6,
+  eBackDispatch_step = 7,
+  eBack_compare_step = 8,
+  eBackMeasure_step = 9,
+  eBackAlloc_step = 10,
+  eBackComplete = 11
+};
+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 Operation_type {
+  eManual_cancel = 1
+};
+bool Operation_type_IsValid(int value);
+const Operation_type Operation_type_MIN = eManual_cancel;
+const Operation_type Operation_type_MAX = eManual_cancel;
+const int Operation_type_ARRAYSIZE = Operation_type_MAX + 1;
+
+const ::google::protobuf::EnumDescriptor* Operation_type_descriptor();
+inline const ::std::string& Operation_type_Name(Operation_type value) {
+  return ::google::protobuf::internal::NameOfEnum(
+    Operation_type_descriptor(), value);
+}
+inline bool Operation_type_Parse(
+    const ::std::string& name, Operation_type* value) {
+  return ::google::protobuf::internal::ParseNamedEnum<Operation_type>(
+    Operation_type_descriptor(), name, value);
+}
+// ===================================================================
+
+class Manual_operation_msg : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:message.Manual_operation_msg) */ {
+ public:
+  Manual_operation_msg();
+  virtual ~Manual_operation_msg();
+
+  Manual_operation_msg(const Manual_operation_msg& from);
+
+  inline Manual_operation_msg& operator=(const Manual_operation_msg& from) {
+    CopyFrom(from);
+    return *this;
+  }
+  #if LANG_CXX11
+  Manual_operation_msg(Manual_operation_msg&& from) noexcept
+    : Manual_operation_msg() {
+    *this = ::std::move(from);
+  }
+
+  inline Manual_operation_msg& operator=(Manual_operation_msg&& 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 Manual_operation_msg& default_instance();
+
+  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static inline const Manual_operation_msg* internal_default_instance() {
+    return reinterpret_cast<const Manual_operation_msg*>(
+               &_Manual_operation_msg_default_instance_);
+  }
+  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+    0;
+
+  void Swap(Manual_operation_msg* other);
+  friend void swap(Manual_operation_msg& a, Manual_operation_msg& b) {
+    a.Swap(&b);
+  }
+
+  // implements Message ----------------------------------------------
+
+  inline Manual_operation_msg* New() const PROTOBUF_FINAL { return New(NULL); }
+
+  Manual_operation_msg* 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 Manual_operation_msg& from);
+  void MergeFrom(const Manual_operation_msg& 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(Manual_operation_msg* 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 license = 2;
+  bool has_license() const;
+  void clear_license();
+  static const int kLicenseFieldNumber = 2;
+  const ::std::string& license() const;
+  void set_license(const ::std::string& value);
+  #if LANG_CXX11
+  void set_license(::std::string&& value);
+  #endif
+  void set_license(const char* value);
+  void set_license(const char* value, size_t size);
+  ::std::string* mutable_license();
+  ::std::string* release_license();
+  void set_allocated_license(::std::string* license);
+
+  // required .message.Base_info base_info = 1;
+  bool has_base_info() const;
+  void clear_base_info();
+  static const int kBaseInfoFieldNumber = 1;
+  const ::message::Base_info& base_info() const;
+  ::message::Base_info* release_base_info();
+  ::message::Base_info* mutable_base_info();
+  void set_allocated_base_info(::message::Base_info* base_info);
+
+  // required .message.Step_type step_type = 3;
+  bool has_step_type() const;
+  void clear_step_type();
+  static const int kStepTypeFieldNumber = 3;
+  ::message::Step_type step_type() const;
+  void set_step_type(::message::Step_type value);
+
+  // required .message.Operation_type operate_type = 4;
+  bool has_operate_type() const;
+  void clear_operate_type();
+  static const int kOperateTypeFieldNumber = 4;
+  ::message::Operation_type operate_type() const;
+  void set_operate_type(::message::Operation_type value);
+
+  // @@protoc_insertion_point(class_scope:message.Manual_operation_msg)
+ private:
+  void set_has_base_info();
+  void clear_has_base_info();
+  void set_has_license();
+  void clear_has_license();
+  void set_has_step_type();
+  void clear_has_step_type();
+  void set_has_operate_type();
+  void clear_has_operate_type();
+
+  // 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 license_;
+  ::message::Base_info* base_info_;
+  int step_type_;
+  int operate_type_;
+  friend struct ::protobuf_manual_5foperation_5fmessage_2eproto::TableStruct;
+  friend void ::protobuf_manual_5foperation_5fmessage_2eproto::InitDefaultsManual_operation_msgImpl();
+};
+// ===================================================================
+
+
+// ===================================================================
+
+#ifdef __GNUC__
+  #pragma GCC diagnostic push
+  #pragma GCC diagnostic ignored "-Wstrict-aliasing"
+#endif  // __GNUC__
+// Manual_operation_msg
+
+// required .message.Base_info base_info = 1;
+inline bool Manual_operation_msg::has_base_info() const {
+  return (_has_bits_[0] & 0x00000002u) != 0;
+}
+inline void Manual_operation_msg::set_has_base_info() {
+  _has_bits_[0] |= 0x00000002u;
+}
+inline void Manual_operation_msg::clear_has_base_info() {
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline const ::message::Base_info& Manual_operation_msg::base_info() const {
+  const ::message::Base_info* p = base_info_;
+  // @@protoc_insertion_point(field_get:message.Manual_operation_msg.base_info)
+  return p != NULL ? *p : *reinterpret_cast<const ::message::Base_info*>(
+      &::message::_Base_info_default_instance_);
+}
+inline ::message::Base_info* Manual_operation_msg::release_base_info() {
+  // @@protoc_insertion_point(field_release:message.Manual_operation_msg.base_info)
+  clear_has_base_info();
+  ::message::Base_info* temp = base_info_;
+  base_info_ = NULL;
+  return temp;
+}
+inline ::message::Base_info* Manual_operation_msg::mutable_base_info() {
+  set_has_base_info();
+  if (base_info_ == NULL) {
+    base_info_ = new ::message::Base_info;
+  }
+  // @@protoc_insertion_point(field_mutable:message.Manual_operation_msg.base_info)
+  return base_info_;
+}
+inline void Manual_operation_msg::set_allocated_base_info(::message::Base_info* base_info) {
+  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
+  if (message_arena == NULL) {
+    delete reinterpret_cast< ::google::protobuf::MessageLite*>(base_info_);
+  }
+  if (base_info) {
+    ::google::protobuf::Arena* submessage_arena = NULL;
+    if (message_arena != submessage_arena) {
+      base_info = ::google::protobuf::internal::GetOwnedMessage(
+          message_arena, base_info, submessage_arena);
+    }
+    set_has_base_info();
+  } else {
+    clear_has_base_info();
+  }
+  base_info_ = base_info;
+  // @@protoc_insertion_point(field_set_allocated:message.Manual_operation_msg.base_info)
+}
+
+// required string license = 2;
+inline bool Manual_operation_msg::has_license() const {
+  return (_has_bits_[0] & 0x00000001u) != 0;
+}
+inline void Manual_operation_msg::set_has_license() {
+  _has_bits_[0] |= 0x00000001u;
+}
+inline void Manual_operation_msg::clear_has_license() {
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline void Manual_operation_msg::clear_license() {
+  license_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  clear_has_license();
+}
+inline const ::std::string& Manual_operation_msg::license() const {
+  // @@protoc_insertion_point(field_get:message.Manual_operation_msg.license)
+  return license_.GetNoArena();
+}
+inline void Manual_operation_msg::set_license(const ::std::string& value) {
+  set_has_license();
+  license_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+  // @@protoc_insertion_point(field_set:message.Manual_operation_msg.license)
+}
+#if LANG_CXX11
+inline void Manual_operation_msg::set_license(::std::string&& value) {
+  set_has_license();
+  license_.SetNoArena(
+    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
+  // @@protoc_insertion_point(field_set_rvalue:message.Manual_operation_msg.license)
+}
+#endif
+inline void Manual_operation_msg::set_license(const char* value) {
+  GOOGLE_DCHECK(value != NULL);
+  set_has_license();
+  license_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
+  // @@protoc_insertion_point(field_set_char:message.Manual_operation_msg.license)
+}
+inline void Manual_operation_msg::set_license(const char* value, size_t size) {
+  set_has_license();
+  license_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
+      ::std::string(reinterpret_cast<const char*>(value), size));
+  // @@protoc_insertion_point(field_set_pointer:message.Manual_operation_msg.license)
+}
+inline ::std::string* Manual_operation_msg::mutable_license() {
+  set_has_license();
+  // @@protoc_insertion_point(field_mutable:message.Manual_operation_msg.license)
+  return license_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+}
+inline ::std::string* Manual_operation_msg::release_license() {
+  // @@protoc_insertion_point(field_release:message.Manual_operation_msg.license)
+  clear_has_license();
+  return license_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+}
+inline void Manual_operation_msg::set_allocated_license(::std::string* license) {
+  if (license != NULL) {
+    set_has_license();
+  } else {
+    clear_has_license();
+  }
+  license_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), license);
+  // @@protoc_insertion_point(field_set_allocated:message.Manual_operation_msg.license)
+}
+
+// required .message.Step_type step_type = 3;
+inline bool Manual_operation_msg::has_step_type() const {
+  return (_has_bits_[0] & 0x00000004u) != 0;
+}
+inline void Manual_operation_msg::set_has_step_type() {
+  _has_bits_[0] |= 0x00000004u;
+}
+inline void Manual_operation_msg::clear_has_step_type() {
+  _has_bits_[0] &= ~0x00000004u;
+}
+inline void Manual_operation_msg::clear_step_type() {
+  step_type_ = 0;
+  clear_has_step_type();
+}
+inline ::message::Step_type Manual_operation_msg::step_type() const {
+  // @@protoc_insertion_point(field_get:message.Manual_operation_msg.step_type)
+  return static_cast< ::message::Step_type >(step_type_);
+}
+inline void Manual_operation_msg::set_step_type(::message::Step_type value) {
+  assert(::message::Step_type_IsValid(value));
+  set_has_step_type();
+  step_type_ = value;
+  // @@protoc_insertion_point(field_set:message.Manual_operation_msg.step_type)
+}
+
+// required .message.Operation_type operate_type = 4;
+inline bool Manual_operation_msg::has_operate_type() const {
+  return (_has_bits_[0] & 0x00000008u) != 0;
+}
+inline void Manual_operation_msg::set_has_operate_type() {
+  _has_bits_[0] |= 0x00000008u;
+}
+inline void Manual_operation_msg::clear_has_operate_type() {
+  _has_bits_[0] &= ~0x00000008u;
+}
+inline void Manual_operation_msg::clear_operate_type() {
+  operate_type_ = 1;
+  clear_has_operate_type();
+}
+inline ::message::Operation_type Manual_operation_msg::operate_type() const {
+  // @@protoc_insertion_point(field_get:message.Manual_operation_msg.operate_type)
+  return static_cast< ::message::Operation_type >(operate_type_);
+}
+inline void Manual_operation_msg::set_operate_type(::message::Operation_type value) {
+  assert(::message::Operation_type_IsValid(value));
+  set_has_operate_type();
+  operate_type_ = value;
+  // @@protoc_insertion_point(field_set:message.Manual_operation_msg.operate_type)
+}
+
+#ifdef __GNUC__
+  #pragma GCC diagnostic pop
+#endif  // __GNUC__
+
+// @@protoc_insertion_point(namespace_scope)
+
+}  // namespace message
+
+namespace google {
+namespace protobuf {
+
+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::Operation_type> : ::google::protobuf::internal::true_type {};
+template <>
+inline const EnumDescriptor* GetEnumDescriptor< ::message::Operation_type>() {
+  return ::message::Operation_type_descriptor();
+}
+
+}  // namespace protobuf
+}  // namespace google
+
+// @@protoc_insertion_point(global_scope)
+
+#endif  // PROTOBUF_manual_5foperation_5fmessage_2eproto__INCLUDED

+ 36 - 0
message/manual_operation_message.proto

@@ -0,0 +1,36 @@
+syntax = "proto2";
+package message;
+import "message_base.proto";
+
+//所属步骤类型
+enum Step_type
+{
+    eAlloc_step=0;
+    eMeasure_step=1;
+    eCompare_step=2;
+    eDispatch_step=3;
+    eConfirm_step=4;
+    eComplete=5;
+
+    eBackConfirm_step=6;
+    eBackDispatch_step=7;
+    eBack_compare_step=8;
+    eBackMeasure_step=9;
+    eBackAlloc_step=10;
+    eBackComplete=11;
+}
+
+//手动操作类型
+enum Operation_type
+{
+    eManual_cancel=1;
+}
+
+//中控手动操作消息
+message Manual_operation_msg
+{
+    required Base_info                  base_info=1;
+    required string                     license=2;
+    required Step_type                  step_type=3;
+    required Operation_type             operate_type=4;
+}

+ 15 - 13
message/message_base.pb.cc

@@ -342,7 +342,7 @@ void AddDescriptorsImpl() {
       "\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*\342\006\n\014Message_ty"
+      "\n \001(\t\022\022\n\nleave_time\030\013 \001(\t*\376\006\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"
@@ -364,20 +364,21 @@ void AddDescriptorsImpl() {
       "\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*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"
-      "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"
+      "r_statu_msg\020\240\001\022\032\n\025eManual_operation_msg\020"
+      "\260\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\neParkspace\020\200\004\022\016\n\teM"
+      "easurer\020\200\006\022\016\n\teDispatch\020\200\010*#\n\005Event\022\014\n\010e"
+      "Storing\020\001\022\014\n\010ePicking\020\002*e\n\013Error_level\022\n"
+      "\n\006NORMAL\020\000\022\024\n\020NEGLIGIBLE_ERROR\020\001\022\017\n\013MINO"
+      "R_ERROR\020\002\022\017\n\013MAJOR_ERROR\020\003\022\022\n\016CRITICAL_E"
+      "RROR\020\004*q\n\020Parkspace_status\022\024\n\020eParkspace"
+      "_empty\020\000\022\027\n\023eParkspace_occupied\020\001\022\030\n\024ePa"
+      "rkspace_reserverd\020\002\022\024\n\020eParkspace_error\020"
+      "\003*(\n\tDirection\022\014\n\010eForward\020\001\022\r\n\teBackwar"
+      "d\020\002"
   };
   ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
-      descriptor, 2215);
+      descriptor, 2243);
   ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
     "message_base.proto", &protobuf_RegisterTypes);
 }
@@ -426,6 +427,7 @@ bool Message_type_IsValid(int value) {
     case 144:
     case 145:
     case 160:
+    case 176:
       return true;
     default:
       return false;

+ 3 - 2
message/message_base.pb.h

@@ -112,11 +112,12 @@ enum Message_type {
   ePickup_command_response_msg = 68,
   eStoring_process_statu_msg = 144,
   ePicking_process_statu_msg = 145,
-  eCentral_controller_statu_msg = 160
+  eCentral_controller_statu_msg = 160,
+  eManual_operation_msg = 176
 };
 bool Message_type_IsValid(int value);
 const Message_type Message_type_MIN = eBase_msg;
-const Message_type Message_type_MAX = eCentral_controller_statu_msg;
+const Message_type Message_type_MAX = eManual_operation_msg;
 const int Message_type_ARRAYSIZE = Message_type_MAX + 1;
 
 const ::google::protobuf::EnumDescriptor* Message_type_descriptor();

+ 3 - 0
message/message_base.proto

@@ -44,6 +44,9 @@ enum Message_type
     eCentral_controller_statu_msg=0xa0;     //中控系统状态消息
 
 
+    eManual_operation_msg=0xb0;             //中控手动操作消息
+
+
 }
 
 //通讯单元

+ 1 - 1
message/process_message.pb.cc

@@ -1032,7 +1032,7 @@ void AddDescriptorsImpl() {
       "_step_statu\022K\n\034back_search_space_step_st"
       "atu\030\013 \001(\0132%.message.Back_search_space_st"
       "ep_statu*C\n\nStep_statu\022\014\n\010eWaiting\020\000\022\014\n\010"
-      "eWorking\020\001\022\n\n\006eError\020\002\022\r\n\teComplete\020\003"
+      "eWorking\020\001\022\n\n\006eError\020\002\022\r\n\teFinished\020\003"
   };
   ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
       descriptor, 4397);

+ 2 - 2
message/process_message.pb.h

@@ -175,11 +175,11 @@ enum Step_statu {
   eWaiting = 0,
   eWorking = 1,
   eError = 2,
-  eComplete = 3
+  eFinished = 3
 };
 bool Step_statu_IsValid(int value);
 const Step_statu Step_statu_MIN = eWaiting;
-const Step_statu Step_statu_MAX = eComplete;
+const Step_statu Step_statu_MAX = eFinished;
 const int Step_statu_ARRAYSIZE = Step_statu_MAX + 1;
 
 const ::google::protobuf::EnumDescriptor* Step_statu_descriptor();

+ 1 - 1
message/process_message.proto

@@ -7,7 +7,7 @@ enum Step_statu
     eWaiting=0;               //完成/空闲
     eWorking=1;
     eError=2;
-    eComplete=3;
+    eFinished=3;
 }
 
 

+ 1 - 0
proto.sh

@@ -5,6 +5,7 @@ protoc -I=./message terminal_message.proto --cpp_out=./message
 protoc -I=./message process_message.proto --cpp_out=./message
 protoc -I=./message dispatch_message.proto --cpp_out=./message
 protoc -I=./message central_control_message.proto --cpp_out=./message
+protoc -I=./message manual_operation_message.proto --cpp_out=./message
 
 
 protoc -I=./system system_setting.proto --cpp_out=./system

+ 72 - 15
solve_exception/exception_solver.cpp

@@ -4,6 +4,7 @@
 
 #include "exception_solver.h"
 #include "command_manager.h"
+#include "communication_message.h"
 
 Exception_solver::Exception_solver() {
 
@@ -12,7 +13,7 @@ Exception_solver::~Exception_solver() {
 
 }
 
-Error_manager Exception_solver::add_task_cancel_condition(std::string license,tq::BaseTask* task)
+Error_manager Exception_solver::add_task_cancel_condition(std::string license,Process_task* task)
 {
     if(m_ptask_map.find(license)==true || task== nullptr)
     {
@@ -40,7 +41,6 @@ Error_manager Exception_solver::encapsulate_msg(Communication_message* message)
     {
         default:
             code= Communication_socket_base::encapsulate_msg(message);
-
             break;
     }
     return code;
@@ -51,9 +51,24 @@ Error_manager Exception_solver::execute_msg(Communication_message* p_msg)
         return Error_manager(POINTER_IS_NULL,CRITICAL_ERROR,"dispatch response msg pointer is null");
 
 
-    //测量response消息
     switch (p_msg->get_message_type())
     {
+        case Communication_message::eManual_operation_msg:
+        {
+            message::Manual_operation_msg msg;
+            if(msg.ParseFromString(p_msg->get_message_buf())==false)
+            {
+                LOG(ERROR)<<"  手动消息解析失败  !!!";
+                break;
+            }
+            if(msg.has_license()==false)
+            {
+                LOG(ERROR)<<"  手动消息解析失败  !!!";
+                break;
+            }
+            m_manual_msg_map[msg.license()]=msg;
+        }
+
         default:break;
     }
     return SUCCESS;
@@ -90,31 +105,72 @@ Error_manager Exception_solver::check_executer(Communication_message* p_msg)
     return SUCCESS;
 }
 
+/*
+     * 等待手动消息
+     */
+Error_manager Exception_solver::waitfor_manual_operate_msg(Process_task* task,message::Manual_operation_msg msg)
+{
+    //清除旧的手动操作消息
+    if(m_manual_msg_map.find(task->license()))
+        m_manual_msg_map.erase(task->license());
+    //监控新的手动操作消息
+    while(task->is_canceled()==false)
+    {
+        if(m_manual_msg_map.find(task->license(),msg))
+        {
+            if(msg.has_base_info() && msg.has_license() && msg.has_operate_type() && msg.has_step_type())
+            {
+                return SUCCESS;
+            }
+        }
+    }
+    return TASK_CANCEL;
+}
 
 /*
      * 处理故障
      */
-Error_manager Exception_solver::solve_exception(Error_manager code,tq::BaseTask* task)
+Error_manager Exception_solver::solve_exception(Error_manager code,Process_task* task)
 {
+    Error_manager code_operate;
     if(code.get_error_level()==CRITICAL_ERROR)
     {
-        //系统急停
-        Command_manager::get_instance_pointer()->pause_system();
-        return SUCCESS;
-    }
-    if(code.get_error_level()==MAJOR_ERROR)
-    {
-        task->Cancel();
+        //四级故障,任务未完成, 且模块未能回退并恢复到初始待机状态
         //关闭出入口
         if(task->GetCategory()==message::eStoring) {
-            StoreProcessTask* pstoring=(StoreProcessTask*)task;
-            Command_manager::get_instance_pointer()->enable_entrance(pstoring->terminal_id(),false);
+            Command_manager::get_instance_pointer()->enable_entrance(task->terminal_id(),Command_manager::Entrance_statu::Disable);
+            LOG(ERROR)<<"关闭入口:"<<task->terminal_id()<<"   四级故障  !!!!!!  等待手动操作 ... ";
+            message::Manual_operation_msg operate_msg;
+            code_operate=waitfor_manual_operate_msg(task,operate_msg);
+            if(code_operate!=SUCCESS)
+                return code_operate;
+            switch (operate_msg.operate_type())
+            {
+                //取消任务
+                case message::eManual_cancel: {
+                    task->Cancel();
+                    return SUCCESS;
+                }
+            }
+
+
         }
         if(task->GetCategory()==message::ePicking) {
-            PickupProcessTask* pPicking=(PickupProcessTask*)task;
-            Command_manager::get_instance_pointer()->enable_export(pPicking->terminal_id(),false);
+            Command_manager::get_instance_pointer()->enable_export(task->terminal_id(),Command_manager::Entrance_statu::Disable);
+            LOG(ERROR)<<"关闭出口:"<<task->terminal_id()<<"   四级故障  !!!!!!  等待手动操作 ...";
+            message::Manual_operation_msg operate_msg;
+            code_operate=waitfor_manual_operate_msg(task,operate_msg);
+            if(code_operate!=SUCCESS)
+                return code_operate;
         }
 
+        //系统急停
+        //Command_manager::get_instance_pointer()->pause_system();
+
+    }
+    if(code.get_error_level()<=MAJOR_ERROR)
+    {
+        //三级故障, 任务未完成,已恢复到待机状态
         return SUCCESS;
     }
 
@@ -125,4 +181,5 @@ Error_manager Exception_solver::solve_exception(Error_manager code,tq::BaseTask*
             break;
         }
     }
+    return SUCCESS;
 }

+ 10 - 3
solve_exception/exception_solver.h

@@ -5,8 +5,9 @@
 #ifndef NNXX_TESTS_ERROR_HANDLING_H
 #define NNXX_TESTS_ERROR_HANDLING_H
 #include "communication_socket_base.h"
+
 #include "singleton.h"
-#include "dispatch_message.pb.h"
+#include "manual_operation_message.pb.h"
 #include "error_code.h"
 #include "thread_safe_map.h"
 #include "StoreProcessTask.h"
@@ -21,7 +22,7 @@ public:
      * 添加流程的任务取消标志位
      * license:车牌号,作为流程任务的唯一标识
      */
-    Error_manager add_task_cancel_condition(std::string license,tq::BaseTask* task);
+    Error_manager add_task_cancel_condition(std::string license,Process_task* task);
     /*
      * 删除流程的任务取消标志位
      * license:车牌号,作为流程任务的唯一标识
@@ -31,7 +32,12 @@ public:
     /*
      * 处理故障
      */
-    Error_manager solve_exception(Error_manager code,tq::BaseTask* task);
+    Error_manager solve_exception(Error_manager code,Process_task* task);
+
+    /*
+     * 等待手动消息
+     */
+    Error_manager waitfor_manual_operate_msg(Process_task* task,message::Manual_operation_msg msg);
 
 protected:
     Exception_solver();
@@ -51,6 +57,7 @@ protected:
 
 private:
     thread_safe_map<std::string,tq::BaseTask*>                  m_ptask_map;
+    thread_safe_map<std::string,message::Manual_operation_msg>  m_manual_msg_map;
 
 };
 

+ 42 - 79
system/PickupProcessTask.cpp

@@ -11,33 +11,21 @@
 #include "exception_solver.h"
 #include "uniq_key.h"
 
-PickupProcessTask::PickupProcessTask(unsigned int terminal_id)
-        :m_publish_statu_thread(nullptr)
+PickupProcessTask::PickupProcessTask(unsigned int terminal_id,message::Car_info car_info)
+       :Process_task(terminal_id,car_info)
 {
-    m_terminor_id=terminal_id;
 }
 PickupProcessTask::~PickupProcessTask()
 {
     Exception_solver::get_instance_pointer()->delete_task_cancel_condition(m_car_info.license());
-    //退出线程
-    m_publish_exit_condition.set_pass_ever(true);
-    if(m_publish_statu_thread!= nullptr)
-    {
-        if(m_publish_statu_thread->joinable())
-        {
-            m_publish_statu_thread->join();
-        }
-        delete m_publish_statu_thread;
-        m_publish_statu_thread=nullptr;
-    }
+
 }
-Error_manager PickupProcessTask::init_task(message::Car_info car_info)
+Error_manager PickupProcessTask::init_task()
 {
     reset_recv_msg();
-    m_car_info=car_info;
     //添加当前流程的任务取消标志位到异常处理模块
     m_cancel_condition.reset(false, false, false);
-    Error_manager code=Exception_solver::get_instance_pointer()->add_task_cancel_condition(car_info.license(),this);
+    Error_manager code=Exception_solver::get_instance_pointer()->add_task_cancel_condition(m_car_info.license(),this);
     if(code!=SUCCESS)
         return code;
 
@@ -62,15 +50,6 @@ Error_manager PickupProcessTask::init_task(message::Car_info car_info)
 
 }
 
-/*
-     * 取消任务
-     */
-void PickupProcessTask::Cancel()
-{
-    m_cancel_condition.set_pass_ever(true);
-    tq::BaseTask::Cancel();
-}
-
 void PickupProcessTask::reset_recv_msg()
 {
     m_search_request_msg=message::Parkspace_search_request_msg();
@@ -115,7 +94,7 @@ Error_manager PickupProcessTask::search_space()
 
     code = Parkspace_communicator::get_instance_pointer()->search_request(request,
             m_search_response_msg,m_cancel_condition);
-    m_step_statu=ePicking_step::eDispatch_step;
+    m_step_statu=eDispatch_step;
     return code;
 }
 
@@ -134,7 +113,7 @@ void PickupProcessTask::Main()
 
     while(1)
     {
-        if(m_step_statu==ePicking_step::eDispatch_step)
+        if(m_step_statu== eDispatch_step)
         {
             code=dispatch_step();
             usleep(1000*1000*(rand()%3));
@@ -144,16 +123,16 @@ void PickupProcessTask::Main()
                                            <<", 车位序号:"<<m_search_response_msg.car_position().index()
                                            <<", 车牌号:"<<m_car_info.license()
                                            <<", 库内车牌号:"<<m_search_response_msg.car_position().car_info().license();
-            m_step_statu = (code != SUCCESS) ? ePicking_step::eBackDispatch_step : ePicking_step::eWait_step;
+            m_step_statu = (code != SUCCESS) ?  eBackDispatch_step :  eWait_step;
         }
-        if(m_step_statu==ePicking_step::eWait_step)
+        if(m_step_statu== eWait_step)
         {
             code=wait_for_leave_step();
             LOG_IF(ERROR, code != SUCCESS) << "等待车辆离开失败,取车终端:"<<m_terminor_id
                                            <<", 车牌号:"<<m_car_info.license();
-            m_step_statu = (code != SUCCESS) ? ePicking_step::eBackWait_step : ePicking_step::eRelease_step;
+            m_step_statu = (code != SUCCESS) ?  eBackWait_step :  eRelease_step;
         }
-        if(m_step_statu==ePicking_step::eRelease_step)
+        if(m_step_statu== eRelease_step)
         {
             code=release_space_step();
             LOG_IF(ERROR, code != SUCCESS) << "取车释放车位失败,取车终端:"<<m_terminor_id
@@ -165,7 +144,7 @@ void PickupProcessTask::Main()
             }
             else
             {
-                m_step_statu=ePicking_step::eComplete;
+                m_step_statu= eComplete;
             }
         }
         if(m_step_statu==eComplete) {
@@ -174,7 +153,7 @@ void PickupProcessTask::Main()
             System_communicator::get_instance_pointer()->post_process_statu(m_process_msg);
             break;
         }
-        if(m_step_statu==ePicking_step::eBackWait_step)
+        if(m_step_statu== eBackWait_step)
         {
             code=back_wait_for_leave_step();
             if(code!=SUCCESS)
@@ -184,10 +163,10 @@ void PickupProcessTask::Main()
             }
             else
             {
-                m_step_statu=ePicking_step::eBackDispatch_step;
+                m_step_statu= eBackDispatch_step;
             }
         }
-        if(m_step_statu==ePicking_step::eBackDispatch_step)
+        if(m_step_statu== eBackDispatch_step)
         {
             code=back_dispatch_step();
             if(code!=SUCCESS)
@@ -197,10 +176,10 @@ void PickupProcessTask::Main()
             }
             else
             {
-                m_step_statu=ePicking_step::eBackSearch_step;
+                m_step_statu= eBackSearch_step;
             }
         }
-        if(m_step_statu==ePicking_step::eBackSearch_step)
+        if(m_step_statu== eBackSearch_step)
         {
             code=back_search_space_step();
             if(code!=SUCCESS)
@@ -210,10 +189,10 @@ void PickupProcessTask::Main()
             }
             else
             {
-                m_step_statu=ePicking_step::eBackComplete;
+                m_step_statu= eBackComplete;
             }
         }
-        if(m_step_statu==ePicking_step::eBackComplete)
+        if(m_step_statu== eBackComplete)
             break;
 
     }
@@ -221,14 +200,14 @@ void PickupProcessTask::Main()
     /*
       * 跳出循环后,判断状态,是否正常结束, 循环跳出状态只有可能是 eBackComplete(异常结束),eComplete(正常结束)
       */
-    if(m_step_statu==ePicking_step::eBackComplete)
+    if(m_step_statu== eBackComplete)
     {
         //异常结束
         usleep(1000*5000);
         LOG(ERROR)<<"异常停车,回退结束"<<"车牌号:"<<m_car_info.license()
                   <<",xxxxxxxxxxxxxx  终端:"<<m_terminor_id<<"  xxxxxxxxxxxxxx";
     }
-    if(m_step_statu==ePicking_step::eComplete)
+    if(m_step_statu== eComplete)
     {
         //正常结束
         usleep(1000*1000);
@@ -355,30 +334,14 @@ Error_manager PickupProcessTask::release_space_step()
         return Error_manager(FAILED,MINOR_ERROR,"取车流程parkspace release response error_code error");
 }
 
-/*
- * 发布状态线程
- */
-void PickupProcessTask::publish_thread_func(PickupProcessTask* ptask)
-{
-    if(ptask)
-    {
-        ptask->publish_step_status();
-    }
-}
-void PickupProcessTask::publish_step_status()
-{
-    //未收到退出信号
-    while(false==m_publish_exit_condition.wait_for_ex(std::chrono::milliseconds(50)))
-    {
-        /*
-         * 通过communicator 发布状态
-         */
-        if(System_communicator::get_instance_pointer())
-        {
-            updata_step_statu_msg();
-            System_communicator::get_instance_pointer()->post_process_statu(m_process_msg);
-        }
 
+void PickupProcessTask::publish_step_status() {
+    /*
+     * 通过communicator 发布状态
+     */
+    if (System_communicator::get_instance_pointer()) {
+        updata_step_statu_msg();
+        System_communicator::get_instance_pointer()->post_process_statu(m_process_msg);
     }
 }
 
@@ -397,41 +360,41 @@ void PickupProcessTask::updata_step_statu_msg()
     release_step_statu.set_step_statu(message::eWaiting);
 
     switch (m_step_statu) {
-        case ePicking_step::eSearch_step: {
+        case  eSearch_step: {
             search_step_statu.set_step_statu(message::eWorking);
             if(m_step_statu==eSearch_step)
                 break;
         }
-        case ePicking_step::eDispatch_step: {
-            search_step_statu.set_step_statu(message::eComplete);
+        case  eDispatch_step: {
+            search_step_statu.set_step_statu(message::eFinished);
             dispatch_step_statu.set_step_statu(message::eWorking);
             dispatch_step_statu.mutable_space_info()->CopyFrom(m_search_response_msg.car_position());
             if(m_step_statu==eDispatch_step)
                 break;
         }
-        case ePicking_step::eWait_step: {
-            dispatch_step_statu.set_step_statu(message::eComplete);
+        case  eWait_step: {
+            dispatch_step_statu.set_step_statu(message::eFinished);
             wait_step_statu.set_step_statu(message::eWorking);
             wait_step_statu.mutable_car_info()->CopyFrom(m_car_info);
-            if(m_step_statu==ePicking_step::eWait_step)
+            if(m_step_statu== eWait_step)
                 break;
         }
-        case ePicking_step::eRelease_step:
+        case  eRelease_step:
         {
-            wait_step_statu.set_step_statu(message::eComplete);
+            wait_step_statu.set_step_statu(message::eFinished);
             release_step_statu.set_step_statu(message::eWorking);
             release_step_statu.mutable_space_info()->CopyFrom(m_search_response_msg.car_position());
-            if(m_step_statu==ePicking_step::eRelease_step)
+            if(m_step_statu== eRelease_step)
                 break;
         }
-        case ePicking_step::eComplete: {
-            release_step_statu.set_step_statu(message::eComplete);
+        case  eComplete: {
+            release_step_statu.set_step_statu(message::eFinished);
             if(m_step_statu==eComplete)
                 break;
         }
-        case ePicking_step::eBackWait_step :{
+        case  eBackWait_step :{
             wait_step_statu.set_step_statu(message::eError);
-            if(m_step_statu==ePicking_step::eBackWait_step)
+            if(m_step_statu== eBackWait_step)
                 break;
         }
         case eBackDispatch_step: {
@@ -445,7 +408,7 @@ void PickupProcessTask::updata_step_statu_msg()
                 break;
         }
         case eBackComplete: {
-            release_step_statu.set_step_statu(message::eComplete);
+            release_step_statu.set_step_statu(message::eFinished);
             if(m_step_statu==eBackComplete)
                 break;
         }

+ 6 - 34
system/PickupProcessTask.h

@@ -7,34 +7,17 @@
 #include <parkspace_allocation_message.pb.h>
 #include "process_message.pb.h"
 #include "error_code.h"
-#include "TaskQueue/BaseTask.h"
+#include "process_task.h"
 #include "dispatch_communicator.h"
 
-class PickupProcessTask :public tq::BaseTask{
-    enum ePicking_step
-    {
-        eSearch_step=0,         //查询数据库
-        eDispatch_step,         //调度
-        eWait_step,             //等待车辆离开
-        eRelease_step,          //释放车位
-        eComplete,              //完成
-
-        eBackWait_step,
-        eBackDispatch_step,
-        eBackSearch_step,
-        eBackComplete
-    };
+class PickupProcessTask :public Process_task{
+
 public:
-    PickupProcessTask(unsigned int terminal_id);
+    PickupProcessTask(unsigned int terminal_id,message::Car_info car_info);
     virtual  ~PickupProcessTask();
-    unsigned int terminal_id(){return m_terminor_id;}
-    Error_manager init_task(message::Car_info car_info);
 
+    Error_manager init_task();
     virtual tq::TaskCategory GetCategory() const{ return message::ePicking;}
-    /*
-     * 取消任务
-     */
-    virtual void Cancel();
 
     /*
      * 查询车位
@@ -75,11 +58,7 @@ protected:
     Error_manager back_release_space_step();
 
 
-    /*
-     * 发布进度
-     */
-    static void publish_thread_func(PickupProcessTask* p_commander);
-    void publish_step_status();
+    virtual void publish_step_status();
     /*
      * 根据当前流程状态,生成状态消息
      */
@@ -88,11 +67,7 @@ protected:
     void reset_recv_msg();
 
 protected:
-    unsigned int                m_terminor_id;
-    message::Car_info           m_car_info;          //当前流程的车辆信息
 
-    std::thread*                    m_publish_statu_thread;             //广播状态线程
-    Thread_condition				m_publish_exit_condition;			//发送的条件变量
 private:
     //查询到的车位信息
     message::Parkspace_search_request_msg                   m_search_request_msg;
@@ -101,9 +76,6 @@ private:
     message::Dispatch_request_msg                           m_dispatch_request_msg;
     message::Dispatch_response_msg                          m_dispatch_response_msg;
 
-    ePicking_step                                           m_step_statu;
-    Thread_condition                                        m_cancel_condition;
-
     message::Picking_process_statu_msg                      m_process_msg;
 
 };

+ 95 - 108
system/StoreProcessTask.cpp

@@ -12,38 +12,26 @@
 #include "exception_solver.h"
 #include "uniq_key.h"
 
-StoreProcessTask::StoreProcessTask(unsigned int terminor_id)
-    :m_publish_statu_thread(nullptr)
+StoreProcessTask::StoreProcessTask(unsigned int terminor_id,message::Car_info car_info)
+    :Process_task(terminor_id,car_info)
 {
-    m_terminor_id=terminor_id;
 }
 
 StoreProcessTask::~StoreProcessTask()
 {
     Exception_solver::get_instance_pointer()->delete_task_cancel_condition(m_car_info.license());
-    //退出线程
-    m_publish_exit_condition.set_pass_ever(true);
-    if(m_publish_statu_thread!= nullptr)
-    {
-        if(m_publish_statu_thread->joinable())
-        {
-            m_publish_statu_thread->join();
-        }
-        delete m_publish_statu_thread;
-        m_publish_statu_thread=nullptr;
-    }
+
 }
 
-Error_manager StoreProcessTask::init_task(message::Locate_information locate_info,message::Car_info car_info)
+Error_manager StoreProcessTask::init_task(message::Locate_information locate_info)
 {
     reset_msg();
 
-    m_car_info=car_info;
     m_locate_info=locate_info;
 
     //添加当前流程的任务取消标志位到异常处理模块
     m_cancel_condition.reset(false, false, false);
-    Error_manager code=Exception_solver::get_instance_pointer()->add_task_cancel_condition(car_info.license(),this);
+    Error_manager code=Exception_solver::get_instance_pointer()->add_task_cancel_condition(m_car_info.license(),this);
     if(code!=SUCCESS)
         return code;
 
@@ -68,15 +56,6 @@ Error_manager StoreProcessTask::init_task(message::Locate_information locate_inf
 
 }
 
-/*
-     * 取消任务
-     */
-void StoreProcessTask::Cancel()
-{
-    m_cancel_condition.set_pass_ever(true);
-    tq::BaseTask::Cancel();
-}
-
 Error_manager StoreProcessTask::locate_step() {
     Error_manager code;
     //检查测量模块状态
@@ -102,8 +81,11 @@ Error_manager StoreProcessTask::locate_step() {
     if(m_measure_response_msg.error_manager().error_code()==0) {
         return SUCCESS;
     }
-    else
-        return Error_manager(FAILED,MINOR_ERROR,m_measure_response_msg.error_manager().error_description().c_str());
+    else {
+        Error_code t_code=(Error_code)m_measure_response_msg.error_manager().error_code();
+        Error_level t_level=(Error_level)m_measure_response_msg.error_manager().error_level();
+        return Error_manager(t_code, t_level, m_measure_response_msg.error_manager().error_description().c_str());
+    }
 
 }
 
@@ -130,7 +112,9 @@ Error_manager StoreProcessTask::compare_step()
  */
 Error_manager StoreProcessTask::back_compare_step()
 {
-
+    int k=rand()%2;
+    if(k==0)
+        return Error_manager(ERROR,CRITICAL_ERROR,"回退检验对比失败");
     return SUCCESS;
 }
 
@@ -179,7 +163,11 @@ Error_manager StoreProcessTask::dispatch_step()
         return SUCCESS;
     }
     else
-        return Error_manager(FAILED,MINOR_ERROR,"dispatch response error_code error");
+    {
+        Error_code t_code=(Error_code)m_dispatch_response_msg.error_manager().error_code();
+        Error_level t_level=(Error_level)m_dispatch_response_msg.error_manager().error_level();
+        return Error_manager(t_code,t_level,"dispatch response error_code error");
+    }
 }
 
 /*
@@ -190,6 +178,8 @@ Error_manager StoreProcessTask::back_dispatch_step()
     //reset 调度请求数据
     m_dispatch_request_msg=message::Dispatch_request_msg();
     m_dispatch_response_msg=message::Dispatch_response_msg();
+
+
     return SUCCESS;
 }
 
@@ -248,7 +238,7 @@ Error_manager StoreProcessTask::alloc_space()
         {
             return Error_manager(ERROR,MINOR_ERROR,"分配车位反馈的车辆信息不匹配");
         }
-        updata_step_statu_msg(message::eComplete);
+        updata_step_statu_msg(message::eFinished);
         //置步骤状态为测量状态.
         m_step_statu=eMeasure_step;
         return SUCCESS;
@@ -256,7 +246,9 @@ Error_manager StoreProcessTask::alloc_space()
     else
     {
         updata_step_statu_msg(message::eError);
-        return Error_manager(FAILED,MINOR_ERROR,"分配车位反馈结果错误");
+        Error_code  t_code=(Error_code)m_parcspace_alloc_response_msg.error_manager().error_code();
+        Error_level t_level=(Error_level)m_parcspace_alloc_response_msg.error_manager().error_level();
+        return Error_manager(t_code,t_level,"分配车位反馈结果错误");
     }
 }
 
@@ -304,7 +296,11 @@ Error_manager StoreProcessTask::confirm_space_step()
         return SUCCESS;
     }
     else
-        return Error_manager(FAILED,MINOR_ERROR,"parkspace confirm response error_code error");
+    {
+        Error_code t_code=(Error_code)confirm_response.error_manager().error_code();
+        Error_level t_level=(Error_level)confirm_response.error_manager().error_level();
+        return Error_manager(t_code,t_level,"parkspace confirm response error_code error");
+    }
 }
 
 
@@ -357,7 +353,11 @@ Error_manager StoreProcessTask::back_alloc_space_step()
         return SUCCESS;
     }
     else
-        return Error_manager(FAILED,MINOR_ERROR,"parkspace release response error_code error");
+    {
+        Error_code t_code=(Error_code)release_response.error_manager().error_code();
+        Error_level t_level=(Error_level)release_response.error_manager().error_level();
+        return Error_manager(t_code,t_level,"parkspace release response error_code error");
+    }
 }
 
 void StoreProcessTask::Main()
@@ -371,139 +371,141 @@ void StoreProcessTask::Main()
     while(m_cancel_condition.wait_for_millisecond(1)==false)
     {
         //第一步,测量
-        if (m_step_statu == eStoring_step::eMeasure_step)
+        if (m_step_statu ==  eMeasure_step)
         {
             //开始定位
             updata_step_statu_msg(message::eWorking);
             code = locate_step();
             usleep(1000 * 1000 * (rand() % 5 + 1));
-            code!=SUCCESS?updata_step_statu_msg(message::eError):updata_step_statu_msg(message::eComplete);
+            code!=SUCCESS?updata_step_statu_msg(message::eError):updata_step_statu_msg(message::eFinished);
 
             LOG_IF(ERROR, code != SUCCESS) << "测量失败:" << code.get_error_description();
-            m_step_statu = (code != SUCCESS) ? eStoring_step::eBackAlloc_step : eStoring_step::eCompare_step;
+            m_step_statu = (code != SUCCESS) ?  eBackAlloc_step :  eCompare_step;
         }
-        if(m_step_statu==eStoring_step::eCompare_step)
+        if(m_step_statu== eCompare_step)
         {
             updata_step_statu_msg(message::eWorking);
             code=compare_step();
             usleep(500*1000);
-            code!=SUCCESS?updata_step_statu_msg(message::eError):updata_step_statu_msg(message::eComplete);
+            code!=SUCCESS?updata_step_statu_msg(message::eError):updata_step_statu_msg(message::eFinished);
             LOG_IF(ERROR, code != SUCCESS) << "检验失败:" << code.get_error_description();
-            m_step_statu = (code != SUCCESS) ? eStoring_step::eBackMeasure_step : eStoring_step::eDispatch_step;
+            m_step_statu = (code != SUCCESS) ?  eBackMeasure_step :  eDispatch_step;
 
         }
         //第二步,调度
-        if (m_step_statu == eStoring_step::eDispatch_step)
+        if (m_step_statu ==  eDispatch_step)
         {
             //开始调度
             updata_step_statu_msg(message::eWorking);
             code = dispatch_step();
             usleep(1000 * 1000 * (rand() % 5));
-            code!=SUCCESS?updata_step_statu_msg(message::eError):updata_step_statu_msg(message::eComplete);
+            code!=SUCCESS?updata_step_statu_msg(message::eError):updata_step_statu_msg(message::eFinished);
             LOG_IF(ERROR, code != SUCCESS) << "调度失败:" << code.get_error_description();
-            m_step_statu = (code != SUCCESS) ? eStoring_step::eBack_compare_step : eStoring_step::eConfirm_step;
+            m_step_statu = (code != SUCCESS) ?  eBack_compare_step :  eConfirm_step;
         }
         //第三步,占据车位
-        if (m_step_statu == eStoring_step::eConfirm_step)
+        if (m_step_statu ==  eConfirm_step)
         {
             updata_step_statu_msg(message::eWorking);
             code = confirm_space_step();
             usleep(1000 * 1000);
-            code!=SUCCESS?updata_step_statu_msg(message::eError):updata_step_statu_msg(message::eComplete);
+            code!=SUCCESS?updata_step_statu_msg(message::eError):updata_step_statu_msg(message::eFinished);
             LOG_IF(ERROR, code != SUCCESS) << "终端号:" << m_terminor_id << "停车流程:" << code.get_error_description() <<
                                            " 车位id :"
                                            << m_parcspace_alloc_response_msg.allocated_space_info().parkspace_id()
                                            << ",车牌:" << m_car_info.license()<<code.to_string();
-            //最后一步故障,提升故障等级,急停
-            m_step_statu = (code != SUCCESS) ? eStoring_step::eBackDispatch_step : eStoring_step::eComplete;
+            m_step_statu = (code != SUCCESS) ?  eBackDispatch_step :  eComplete;
         }
         //第四步,完成,退出循环
-        if (m_step_statu == eStoring_step::eComplete)
+        if (m_step_statu ==  eComplete)
         {
             //流程结束前,保证至少发送一次流程完成状态
-            updata_step_statu_msg(message::eComplete);
+            updata_step_statu_msg(message::eFinished);
             break;
         }
 
         //回退confirm  ------------------------------------华丽的分割线------------------------------------------
 
-        if (m_step_statu == eStoring_step::eBackConfirm_step)
+        if (m_step_statu ==  eBackConfirm_step)
         {
             updata_step_statu_msg(message::eWorking);
             usleep(1000*1000);
-            updata_step_statu_msg(message::eComplete);
-            m_step_statu=eStoring_step::eBackDispatch_step;
+            updata_step_statu_msg(message::eFinished);
+            m_step_statu= eBackDispatch_step;
         }
-        if(m_step_statu==eStoring_step::eBackDispatch_step)
+        if(m_step_statu== eBackDispatch_step)
         {
             updata_step_statu_msg(message::eWorking);
             code=back_dispatch_step();
             usleep(1000*1000);
-            code!=SUCCESS?updata_step_statu_msg(message::eError):updata_step_statu_msg(message::eComplete);
-            if(code!=SUCCESS)
+            code!=SUCCESS?updata_step_statu_msg(message::eError):updata_step_statu_msg(message::eFinished);
+            if(code.get_error_level()>=MAJOR_ERROR)
             {
                 //提升错误等级为四级
+                Exception_solver::get_instance_pointer()->solve_exception(code,this);
                 break;
             }
             else
             {
-                m_step_statu=eStoring_step::eBack_compare_step;
+                m_step_statu= eBack_compare_step;
             }
 
         }
 
-        if(m_step_statu==eStoring_step::eBack_compare_step)
+        if(m_step_statu== eBack_compare_step)
         {
             updata_step_statu_msg(message::eWorking);
             code=back_compare_step();
             usleep(1000*1000);
-            code!=SUCCESS?updata_step_statu_msg(message::eError):updata_step_statu_msg(message::eComplete);
-            if(code!=SUCCESS)
+            code!=SUCCESS?updata_step_statu_msg(message::eError):updata_step_statu_msg(message::eFinished);
+            if(code.get_error_level()>=MAJOR_ERROR)
             {
-                //提升错误等级为四级
+                Exception_solver::get_instance_pointer()->solve_exception(code,this);
                 break;
             }
             else
             {
-                m_step_statu=eStoring_step::eBackMeasure_step;
+                m_step_statu= eBackMeasure_step;
             }
         }
 
-        if(m_step_statu==eStoring_step::eBackMeasure_step)
+        if(m_step_statu== eBackMeasure_step)
         {
             updata_step_statu_msg(message::eWorking);
             code=back_locate_step();
             usleep(1000*1000);
-            code!=SUCCESS?updata_step_statu_msg(message::eError):updata_step_statu_msg(message::eComplete);
-            if(code!=SUCCESS)
+            code!=SUCCESS?updata_step_statu_msg(message::eError):updata_step_statu_msg(message::eFinished);
+            if(code.get_error_level()>=MAJOR_ERROR)
             {
                 //提升错误等级为四级
+                Exception_solver::get_instance_pointer()->solve_exception(code,this);
                 break;
             }
             else
             {
-                m_step_statu=eStoring_step::eBackAlloc_step;
+                m_step_statu= eBackAlloc_step;
             }
         }
-        if(m_step_statu==eStoring_step::eBackAlloc_step)
+        if(m_step_statu== eBackAlloc_step)
         {
             updata_step_statu_msg(message::eWorking);
             code=back_alloc_space_step();
             usleep(1000*1000);
-            code!=SUCCESS?updata_step_statu_msg(message::eError):updata_step_statu_msg(message::eComplete);
-            if(code!=SUCCESS)
+            code!=SUCCESS?updata_step_statu_msg(message::eError):updata_step_statu_msg(message::eFinished);
+            if(code.get_error_level()>=MAJOR_ERROR)
             {
                 //提升错误等级为四级
+                Exception_solver::get_instance_pointer()->solve_exception(code,this);
                 break;
             }
             else
             {
-                m_step_statu=eStoring_step::eBackComplete;
+                m_step_statu= eBackComplete;
             }
         }
-        if(m_step_statu==eStoring_step::eBackComplete)
+        if(m_step_statu== eBackComplete)
         {
-            updata_step_statu_msg(message::eComplete);
+            updata_step_statu_msg(message::eFinished);
             break;
         }
     }
@@ -517,14 +519,14 @@ void StoreProcessTask::Main()
         return ;
     }
 
-    if(m_step_statu==eStoring_step::eBackComplete)
+    if(m_step_statu== eBackComplete)
     {
         //异常结束
         usleep(1000*1000);
         LOG(ERROR)<<"异常停车,回退结束"<<"车牌号:"<<m_car_info.license()
             <<",xxxxxxxxxxxxxx  终端:"<<m_terminor_id<<"  xxxxxxxxxxxxxx";
     }
-    if(m_step_statu==eStoring_step::eComplete)
+    if(m_step_statu== eComplete)
     {
         //正常结束
         usleep(1000*500);
@@ -533,29 +535,14 @@ void StoreProcessTask::Main()
     }
 }
 
-/*
- * 发布状态线程
- */
-void StoreProcessTask::publish_thread_func(StoreProcessTask* ptask)
-{
-    if(ptask)
-    {
-        ptask->publish_step_status();
-    }
-}
-void StoreProcessTask::publish_step_status()
-{
-    //未收到退出信号
-    while(false==m_publish_exit_condition.wait_for_ex(std::chrono::milliseconds(50)))
-    {
-        /*
-         * 通过communicator 发布状态
-         */
-        if(System_communicator::get_instance_pointer())
-        {
-            std::lock_guard<std::mutex>         lock(m_process_msg_lock);
-            System_communicator::get_instance_pointer()->post_process_statu(m_process_msg);
-        }
+
+void StoreProcessTask::publish_step_status() {
+    /*
+     * 通过communicator 发布状态
+     */
+    if (System_communicator::get_instance_pointer()) {
+        std::lock_guard<std::mutex> lock(m_process_msg_lock);
+        System_communicator::get_instance_pointer()->post_process_statu(m_process_msg);
     }
 }
 
@@ -566,13 +553,13 @@ void StoreProcessTask::updata_step_statu_msg(message::Step_statu statu)
 {
     std::lock_guard<std::mutex>         lock(m_process_msg_lock);
     switch (m_step_statu) {
-        case eStoring_step::eAlloc_step: {
+        case  eAlloc_step: {
                 message::Alloc_space_step_statu alloc_step_statu;
                 alloc_step_statu.set_step_statu(statu);
                 m_process_msg.mutable_alloc_space_step()->CopyFrom(alloc_step_statu);
             break;
         }
-        case eStoring_step::eMeasure_step: {
+        case  eMeasure_step: {
 
                 message::Measure_step_statu measure_step_statu;
                 measure_step_statu.set_step_statu(statu);
@@ -580,7 +567,7 @@ void StoreProcessTask::updata_step_statu_msg(message::Step_statu statu)
                 m_process_msg.mutable_measure_step()->CopyFrom(measure_step_statu);
            break;
         }
-        case eStoring_step::eCompare_step:{
+        case  eCompare_step:{
             message::Compare_step_statu     compare_step;
             compare_step.mutable_locate_info_wj()->CopyFrom(m_locate_info);
             compare_step.mutable_locate_info_dj()->CopyFrom(m_measure_response_msg.locate_information());
@@ -589,7 +576,7 @@ void StoreProcessTask::updata_step_statu_msg(message::Step_statu statu)
             m_process_msg.mutable_compare_step()->CopyFrom(compare_step);
             break;
         }
-        case eStoring_step::eDispatch_step: {
+        case  eDispatch_step: {
             message::Dispatch_store_step_statu          dispatch_step_statu;
             dispatch_step_statu.set_step_statu(statu);
             dispatch_step_statu.mutable_locate_info()->CopyFrom(m_locate_info);
@@ -597,24 +584,24 @@ void StoreProcessTask::updata_step_statu_msg(message::Step_statu statu)
             m_process_msg.mutable_dispatch_step()->CopyFrom(dispatch_step_statu);
             break;
         }
-        case eStoring_step::eConfirm_step: {
+        case  eConfirm_step: {
             message::Confirm_space_step_statu           confirm_step_statu;
             confirm_step_statu.set_step_statu(statu);
             confirm_step_statu.mutable_space_info()->CopyFrom(m_parcspace_alloc_response_msg.allocated_space_info());
             m_process_msg.mutable_confirm_space_step()->CopyFrom(confirm_step_statu);
             break;
         }
-        case eStoring_step::eComplete: {
+        case  eComplete: {
             m_process_msg.set_completed(true);
             break;
         }
-        case eStoring_step::eBackConfirm_step: {
+        case  eBackConfirm_step: {
                 message::Back_confirm_space_step_statu back_confirm_step_statu;
                 back_confirm_step_statu.set_step_statu(statu);
                 m_process_msg.mutable_back_confirm_step()->CopyFrom(back_confirm_step_statu);
             break;
         }
-        case eStoring_step::eBackDispatch_step: {
+        case  eBackDispatch_step: {
             message::Back_dispatch_store_step_statu   back_dispatch_step_statu;
             back_dispatch_step_statu.set_step_statu(statu);
             back_dispatch_step_statu.mutable_space_info()->CopyFrom(m_parcspace_alloc_response_msg.allocated_space_info());
@@ -622,7 +609,7 @@ void StoreProcessTask::updata_step_statu_msg(message::Step_statu statu)
             m_process_msg.mutable_back_dispatch_step()->CopyFrom(back_dispatch_step_statu);
             break;
         }
-        case eStoring_step::eBack_compare_step:{
+        case  eBack_compare_step:{
             message::Back_compare_step_statu    back_compare_step_statu;
             back_compare_step_statu.set_step_statu(statu);
             back_compare_step_statu.mutable_locate_info_wj()->CopyFrom(m_locate_info);
@@ -631,20 +618,20 @@ void StoreProcessTask::updata_step_statu_msg(message::Step_statu statu)
             m_process_msg.mutable_back_compare_step()->CopyFrom(back_compare_step_statu);
             break;
         }
-        case eStoring_step::eBackMeasure_step: {
+        case  eBackMeasure_step: {
             message::Back_measure_step_statu        back_measure_step_statu;
             back_measure_step_statu.set_step_statu(statu);
             m_process_msg.mutable_back_measure_step()->CopyFrom(back_measure_step_statu);
             break;
         }
-        case eStoring_step::eBackAlloc_step: {
+        case  eBackAlloc_step: {
             message::Back_alloc_space_step_statu    back_alloc_step_statu;
             back_alloc_step_statu.set_step_statu(statu);
             back_alloc_step_statu.mutable_space_info()->CopyFrom(m_parcspace_alloc_response_msg.allocated_space_info());
             m_process_msg.mutable_back_alloc_space_step()->CopyFrom(back_alloc_step_statu);
             break;
         }
-        case eStoring_step::eBackComplete: {
+        case  eBackComplete: {
             m_process_msg.set_back_completed(true);
             break;
         }

+ 9 - 41
system/StoreProcessTask.h

@@ -7,32 +7,16 @@
 
 #include <parkspace_allocation_message.pb.h>
 #include "dispatch_communicator.h"
-#include "TaskQueue/BaseTask.h"
+#include "process_task.h"
 #include "Locate_communicator.h"
 #include "process_message.pb.h"
 
-class StoreProcessTask :public tq::BaseTask{
-    enum eStoring_step
-    {
-        eAlloc_step=0,
-        eMeasure_step,
-        eCompare_step,
-        eDispatch_step,
-        eConfirm_step,
-        eComplete,
-
-        eBackConfirm_step,
-        eBackDispatch_step,
-        eBack_compare_step,
-        eBackMeasure_step,
-        eBackAlloc_step,
-        eBackComplete
-    };
+class StoreProcessTask :public Process_task{
+
 public:
-    StoreProcessTask(unsigned int command_id);
+    StoreProcessTask(unsigned int command_id,message::Car_info car_info);
     virtual  ~StoreProcessTask();
-    unsigned int terminal_id(){return m_terminor_id;}
-    Error_manager init_task(message::Locate_information locate_info,message::Car_info car_info);
+    Error_manager init_task(message::Locate_information locate_info);
 
     /*
      * 分配车位
@@ -44,15 +28,12 @@ public:
      */
     Error_manager back_alloc_space_step();
 
-    /*
-     * 取消任务
-     */
-    virtual void Cancel();
     /*
      * 获取任务类型
      */
     virtual tq::TaskCategory GetCategory() const{ return message::eStoring;}
 
+
 protected:
     virtual void Main();
 
@@ -94,19 +75,14 @@ protected:
      */
     void reset_msg();
 
-    /*
-     * 发布进度
-     */
-    static void publish_thread_func(StoreProcessTask* p_commander);
-    void publish_step_status();
+    virtual void publish_step_status();
     /*
      * 根据当前流程状态,生成状态消息
      */
     void updata_step_statu_msg(message::Step_statu statu);
 
 protected:
-    unsigned int                m_terminor_id;
-    message::Car_info           m_car_info;          //当前流程的车辆标识(车牌号)
+
     message::Locate_information                     m_locate_info;
 
     //保存请求
@@ -121,16 +97,8 @@ protected:
     message::Parkspace_allocation_response_msg      m_parcspace_alloc_response_msg; //分配的车位数据
     message::Dispatch_response_msg                  m_dispatch_response_msg;        //调度模块的反馈数据
 
-
 private:
-    std::thread*                    m_publish_statu_thread;             //广播状态线程
-    Thread_condition				m_publish_exit_condition;			//发送的条件变量
-
-    eStoring_step                            m_step_statu;
-    std::mutex                              m_process_msg_lock;
-    message::Storing_process_statu_msg      m_process_msg;
-
-    Thread_condition                m_cancel_condition;                 //取消任务标志位
+    message::Storing_process_statu_msg          m_process_msg;
 
 };
 

+ 35 - 14
system/command_manager.cpp

@@ -13,6 +13,7 @@
 Command_manager::Command_manager()
     :m_thread_queue_process(nullptr)
     ,m_system_paused(false)
+    ,m_publish_statu_thread(nullptr)
 {
 
 }
@@ -24,6 +25,17 @@ Command_manager::~Command_manager()
         m_thread_queue_process->WaitForFinish();
         m_thread_queue_process->Stop();
     }
+    //退出发布线程
+    m_publish_exit_condition.set_pass_ever(true);
+    if(m_publish_statu_thread!= nullptr)
+    {
+        if(m_publish_statu_thread->joinable())
+        {
+            m_publish_statu_thread->join();
+        }
+        delete m_publish_statu_thread;
+        m_publish_statu_thread=nullptr;
+    }
 
 }
 
@@ -52,7 +64,6 @@ Error_manager Command_manager::init(setting::System_setting system_setting) {
         m_thread_queue_process->Start(48);
     }
 
-
     /*
      * 此处添加等待各个通讯模块正常代码
      */
@@ -134,6 +145,15 @@ Error_manager Command_manager::init(setting::System_setting system_setting) {
     }
     m_system_setting=system_setting;
 
+    /*
+     * 创建发布线程
+     */
+    if(m_publish_statu_thread== nullptr)
+    {
+        m_publish_exit_condition.reset(false, false, false);
+        m_publish_statu_thread=new std::thread(publish_statu_function,this);
+    }
+
     return SUCCESS;
 
 }
@@ -148,6 +168,7 @@ Error_manager Command_manager::execute_store_command(message::Store_command_requ
     base_info.set_sender(message::eMain);
     base_info.set_receiver(message::eTerminor);
     response.mutable_base_info()->CopyFrom(base_info);
+    response.set_terminal_id(request.terminal_id());
 
     message::Error_manager error_msg;
     error_msg.set_error_code(0);
@@ -164,7 +185,7 @@ Error_manager Command_manager::execute_store_command(message::Store_command_requ
         error_msg.set_error_code(PAUSE);
         error_msg.set_error_description("急停");
         response.mutable_code()->CopyFrom(error_msg);
-        return Error_manager(PAUSE, CRITICAL_ERROR, "急停");
+        return Error_manager(PAUSE, CRITICAL_ERROR, "系统已急停");
     }
 
     //判断入口是否开放
@@ -179,7 +200,7 @@ Error_manager Command_manager::execute_store_command(message::Store_command_requ
         error_msg.set_error_code(ERROR);
         error_msg.set_error_description("入口已关闭 Disable");
         response.mutable_code()->CopyFrom(error_msg);
-        return Error_manager(ERROR, CRITICAL_ERROR, "中控入口已停止使用");
+        return Error_manager(ERROR, CRITICAL_ERROR, "入口已禁止使用 Disable");
     }
 
     if (request.base_info().msg_type() == message::eStore_command_request_msg
@@ -233,10 +254,10 @@ Error_manager Command_manager::execute_store_command(message::Store_command_requ
 
                         LOG(INFO) << "收到停车,车牌:"<< request.car_info().license() <<
                                   ",终端:" << request.terminal_id()<<"............................";
-                        tq::BaseTask *ptask = new StoreProcessTask(request.terminal_id());
+                        tq::BaseTask *ptask = new StoreProcessTask(request.terminal_id(),request.car_info());
                         StoreProcessTask *pStore_task = (StoreProcessTask *) ptask;
                         //初始化流程
-                        pStore_task->init_task(locate_info, request.car_info());
+                        pStore_task->init_task(locate_info);
 
                         //获取车位
                         Error_manager code = pStore_task->alloc_space();
@@ -278,6 +299,7 @@ Error_manager Command_manager::execute_pickup_command(message::Pickup_command_re
     base_info.set_sender(message::eMain);
     base_info.set_receiver(message::eTerminor);
     response.mutable_base_info()->CopyFrom(base_info);
+    response.set_terminal_id(request.terminal_id());
 
     message::Error_manager error_msg;
     error_msg.set_error_code(0);
@@ -345,10 +367,10 @@ Error_manager Command_manager::execute_pickup_command(message::Pickup_command_re
         //一切正常,接受指令
         Error_manager code;
         LOG(WARNING)<<"收到取车-----------------------------"<<request.car_info().license();
-        tq::BaseTask* ptask=new PickupProcessTask(request.terminal_id());
+        tq::BaseTask* ptask=new PickupProcessTask(request.terminal_id(),request.car_info());
         PickupProcessTask* pPick_task=(PickupProcessTask*)ptask;
         //初始化流程
-        code=pPick_task->init_task(request.car_info());
+        code=pPick_task->init_task();
         /////查询车位
         code=pPick_task->search_space();
 
@@ -376,22 +398,22 @@ Error_manager Command_manager::execute_pickup_command(message::Pickup_command_re
 /*
     * 控制入口 开放或者关闭
     */
-Error_manager Command_manager::enable_entrance(int terminal_id,bool enable)
+Error_manager Command_manager::enable_entrance(int terminal_id,Entrance_statu statu)
 {
     if(terminal_id<0 || terminal_id>m_system_setting.entrance_num())
         return Error_manager(ERROR,MINOR_ERROR,"xxxx");
-    m_input_entrance_statu[terminal_id]=(enable?Enable:Disable);
+    m_input_entrance_statu[terminal_id]=statu;
     return SUCCESS;
 }
 
 /*
  * 控制出口 开放或者关闭
  */
-Error_manager Command_manager::enable_export(int terminal_id,bool enable)
+Error_manager Command_manager::enable_export(int terminal_id,Entrance_statu statu)
 {
     if(terminal_id<0 || terminal_id>m_system_setting.export_num())
         return Error_manager(ERROR,MINOR_ERROR,"xxxx");
-    m_output_entrance_statu[terminal_id]=(enable?Enable:Disable);
+    m_output_entrance_statu[terminal_id]=statu;
 }
 
 /*
@@ -418,18 +440,17 @@ void Command_manager::publish_statu()
         baseInfo.set_sender(message::eMain);
         baseInfo.set_receiver(message::eEmpty);
         msg.mutable_base_info()->CopyFrom(baseInfo);
-        msg.set_paused(m_system_paused);
         for(int i=0;i<m_system_setting.entrance_num();++i)
         {
             message::Entrance_statu entrance_statu;
-            entrance_statu=(m_input_entrance_statu[i]==Enable)?message::eEnable:message::eDisable;
+            entrance_statu=message::Entrance_statu (m_input_entrance_statu[i]);
             msg.add_entrance_statu_vector(entrance_statu);
         }
 
         for(int i=0;i<m_system_setting.export_num();++i)
         {
             message::Entrance_statu entrance_statu;
-            entrance_statu=(m_output_entrance_statu[i]==Enable)?message::eEnable:message::eDisable;
+            entrance_statu=message::Entrance_statu (m_input_entrance_statu[i]);
             msg.add_export_statu_vector(entrance_statu);
         }
 

+ 5 - 3
system/command_manager.h

@@ -22,10 +22,12 @@
 
 class Command_manager :public Singleton<Command_manager>{
     friend Singleton<Command_manager>;
+public:
     enum Entrance_statu
     {
         Enable=0,
-        Disable
+        Disable,
+        Paused,
     };
 public:
     ~Command_manager();
@@ -48,12 +50,12 @@ public:
     /*
      * 控制入口 开放或者关闭
      */
-    Error_manager enable_entrance(int terminal_id,bool enable);
+    Error_manager enable_entrance(int terminal_id,Entrance_statu statu);
 
     /*
      * 控制出口 开放或者关闭
      */
-    Error_manager enable_export(int terminal_id,bool enable);
+    Error_manager enable_export(int terminal_id, Entrance_statu statu);
 
     /*
      * pause,系统急停,急停状态下不允许自动流程的指令执行,允许管理员手动指令执行

+ 58 - 0
system/process_task.cpp

@@ -0,0 +1,58 @@
+//
+// Created by zx on 2020/8/26.
+//
+
+#include "process_task.h"
+
+Process_task::Process_task(unsigned int terminal_id,message::Car_info car_info)
+        :m_publish_statu_thread(nullptr)
+{
+    m_terminor_id=terminal_id;
+    m_car_info=car_info;
+}
+Process_task::~Process_task()
+{
+    //退出线程
+    m_publish_exit_condition.set_pass_ever(true);
+    if(m_publish_statu_thread!= nullptr)
+    {
+        if(m_publish_statu_thread->joinable())
+        {
+            m_publish_statu_thread->join();
+        }
+        delete m_publish_statu_thread;
+        m_publish_statu_thread=nullptr;
+    }
+}
+
+/*
+ * 取消任务
+ */
+void Process_task::Cancel()
+{
+    m_step_statu=eBackComplete;
+    m_cancel_condition.set_pass_ever(true);
+    tq::BaseTask::Cancel();
+}
+
+/*
+ * 发布进度
+ */
+void Process_task::publish_thread_func(Process_task* ptask)
+{
+    if(ptask)
+    {
+        //未收到退出信号
+        while(false==ptask->m_publish_exit_condition.wait_for_ex(std::chrono::milliseconds(50))) {
+            ptask->publish_step_status();
+        }
+    }
+}
+
+/*
+     * 任务是否取消
+     */
+bool Process_task::is_canceled()
+{
+    return m_cancel_condition.wait_for_millisecond(1);
+}

+ 80 - 0
system/process_task.h

@@ -0,0 +1,80 @@
+//
+// Created by zx on 2020/8/26.
+//
+
+#ifndef NNXX_TESTS_PROCESS_TASK_H
+#define NNXX_TESTS_PROCESS_TASK_H
+#include "thread_condition.h"
+#include "TaskQueue/BaseTask.h"
+#include "process_message.pb.h"
+
+/*
+ * 停取车流程基类, 包括任务创建, 状态消息发布线程启动, 任务取消等公共功能
+ * 该类继承自tq::BaseTask类, 可让入 tq 线程池, 执行虚函数 Main
+ * 派生出 停车任务类(StoreProcessTask)与取车任务类(PickupProcessTask)
+ */
+class Process_task : public tq::BaseTask{
+protected:
+    enum EStep_type
+    {
+        eAlloc_step=0,
+        eMeasure_step,
+        eCompare_step,
+        eDispatch_step,
+        eConfirm_step,
+
+        eSearch_step,         //查询数据库
+        eWait_step,             //等待车辆离开
+        eRelease_step,          //释放车位
+
+        eComplete,              //完成
+
+        eBackConfirm_step,
+        eBack_compare_step,
+        eBackMeasure_step,
+        eBackAlloc_step,
+
+        eBackWait_step,
+        eBackDispatch_step,
+        eBackSearch_step,
+
+        eBackComplete
+    };
+
+
+public:
+    Process_task(unsigned int command_id,message::Car_info car_info);
+    virtual ~Process_task();
+    unsigned int terminal_id(){return m_terminor_id;}
+    std::string license(){ return m_car_info.license();}
+    /*
+     * 取消任务
+     */
+    virtual void Cancel();
+
+    /*
+     * 任务是否取消
+     */
+    virtual bool is_canceled();
+
+protected:
+    /*
+     * 发布进度消息
+     */
+    static void publish_thread_func(Process_task* ptask);
+    virtual void publish_step_status()=0;
+
+
+protected:
+    unsigned int                            m_terminor_id;
+    message::Car_info                       m_car_info;                         //当前流程的车辆信息
+    EStep_type                              m_step_statu;
+
+    std::thread*                            m_publish_statu_thread;             //广播状态线程
+    Thread_condition				        m_publish_exit_condition;			//发送的条件变量
+    Thread_condition                        m_cancel_condition;                 //取消任务标志位
+    std::mutex                              m_process_msg_lock;                 //状态消息锁
+};
+
+
+#endif //NNXX_TESTS_PROCESS_TASK_H

+ 77 - 36
system/system_setting.pb.cc

@@ -61,18 +61,20 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUT
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::setting::System_setting, park_space_port_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::setting::System_setting, measurer_port_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::setting::System_setting, dispatcher_port_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::setting::System_setting, exception_handle_port_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::setting::System_setting, entrance_num_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::setting::System_setting, export_num_),
   0,
-  3,
   4,
   5,
   6,
+  7,
+  3,
   1,
   2,
 };
 static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
-  { 0, 12, sizeof(::setting::System_setting)},
+  { 0, 13, sizeof(::setting::System_setting)},
 };
 
 static ::google::protobuf::Message const * const file_default_instances[] = {
@@ -101,15 +103,16 @@ void protobuf_RegisterTypes(const ::std::string&) {
 void AddDescriptorsImpl() {
   InitDefaults();
   static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
-      "\n\024system_setting.proto\022\007setting\"\307\001\n\016Syst"
+      "\n\024system_setting.proto\022\007setting\"\354\001\n\016Syst"
       "em_setting\022\017\n\007bind_ip\030\001 \002(\t\022\034\n\rterminor_"
       "port\030\002 \001(\005:\00530000\022\036\n\017park_space_port\030\003 \001"
       "(\005:\00530001\022\034\n\rmeasurer_port\030\004 \001(\005:\00530002\022"
-      "\036\n\017dispatcher_port\030\005 \001(\005:\00530003\022\024\n\014entra"
-      "nce_num\030\006 \002(\005\022\022\n\nexport_num\030\007 \002(\005"
+      "\036\n\017dispatcher_port\030\005 \001(\005:\00530003\022#\n\025excep"
+      "tion_handle_port\030\006 \001(\005:\0043004\022\024\n\014entrance"
+      "_num\030\007 \002(\005\022\022\n\nexport_num\030\010 \002(\005"
   };
   ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
-      descriptor, 233);
+      descriptor, 270);
   ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
     "system_setting.proto", &protobuf_RegisterTypes);
 }
@@ -137,6 +140,7 @@ const int System_setting::kTerminorPortFieldNumber;
 const int System_setting::kParkSpacePortFieldNumber;
 const int System_setting::kMeasurerPortFieldNumber;
 const int System_setting::kDispatcherPortFieldNumber;
+const int System_setting::kExceptionHandlePortFieldNumber;
 const int System_setting::kEntranceNumFieldNumber;
 const int System_setting::kExportNumFieldNumber;
 #endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
@@ -171,6 +175,7 @@ void System_setting::SharedCtor() {
   ::memset(&entrance_num_, 0, static_cast<size_t>(
       reinterpret_cast<char*>(&export_num_) -
       reinterpret_cast<char*>(&entrance_num_)) + sizeof(export_num_));
+  exception_handle_port_ = 3004;
   terminor_port_ = 30000;
   park_space_port_ = 30001;
   measurer_port_ = 30002;
@@ -220,10 +225,11 @@ void System_setting::Clear() {
     GOOGLE_DCHECK(!bind_ip_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
     (*bind_ip_.UnsafeRawStringPointer())->clear();
   }
-  if (cached_has_bits & 126u) {
+  if (cached_has_bits & 254u) {
     ::memset(&entrance_num_, 0, static_cast<size_t>(
         reinterpret_cast<char*>(&export_num_) -
         reinterpret_cast<char*>(&entrance_num_)) + sizeof(export_num_));
+    exception_handle_port_ = 3004;
     terminor_port_ = 30000;
     park_space_port_ = 30001;
     measurer_port_ = 30002;
@@ -315,24 +321,38 @@ bool System_setting::MergePartialFromCodedStream(
         break;
       }
 
-      // required int32 entrance_num = 6;
+      // optional int32 exception_handle_port = 6 [default = 3004];
       case 6: {
         if (static_cast< ::google::protobuf::uint8>(tag) ==
             static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) {
-          set_has_entrance_num();
+          set_has_exception_handle_port();
           DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                    ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &entrance_num_)));
+                 input, &exception_handle_port_)));
         } else {
           goto handle_unusual;
         }
         break;
       }
 
-      // required int32 export_num = 7;
+      // required int32 entrance_num = 7;
       case 7: {
         if (static_cast< ::google::protobuf::uint8>(tag) ==
             static_cast< ::google::protobuf::uint8>(56u /* 56 & 0xFF */)) {
+          set_has_entrance_num();
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
+                 input, &entrance_num_)));
+        } else {
+          goto handle_unusual;
+        }
+        break;
+      }
+
+      // required int32 export_num = 8;
+      case 8: {
+        if (static_cast< ::google::protobuf::uint8>(tag) ==
+            static_cast< ::google::protobuf::uint8>(64u /* 64 & 0xFF */)) {
           set_has_export_num();
           DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                    ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
@@ -381,33 +401,38 @@ void System_setting::SerializeWithCachedSizes(
   }
 
   // optional int32 terminor_port = 2 [default = 30000];
-  if (cached_has_bits & 0x00000008u) {
+  if (cached_has_bits & 0x00000010u) {
     ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->terminor_port(), output);
   }
 
   // optional int32 park_space_port = 3 [default = 30001];
-  if (cached_has_bits & 0x00000010u) {
+  if (cached_has_bits & 0x00000020u) {
     ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->park_space_port(), output);
   }
 
   // optional int32 measurer_port = 4 [default = 30002];
-  if (cached_has_bits & 0x00000020u) {
+  if (cached_has_bits & 0x00000040u) {
     ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->measurer_port(), output);
   }
 
   // optional int32 dispatcher_port = 5 [default = 30003];
-  if (cached_has_bits & 0x00000040u) {
+  if (cached_has_bits & 0x00000080u) {
     ::google::protobuf::internal::WireFormatLite::WriteInt32(5, this->dispatcher_port(), output);
   }
 
-  // required int32 entrance_num = 6;
+  // optional int32 exception_handle_port = 6 [default = 3004];
+  if (cached_has_bits & 0x00000008u) {
+    ::google::protobuf::internal::WireFormatLite::WriteInt32(6, this->exception_handle_port(), output);
+  }
+
+  // required int32 entrance_num = 7;
   if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(6, this->entrance_num(), output);
+    ::google::protobuf::internal::WireFormatLite::WriteInt32(7, this->entrance_num(), output);
   }
 
-  // required int32 export_num = 7;
+  // required int32 export_num = 8;
   if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(7, this->export_num(), output);
+    ::google::protobuf::internal::WireFormatLite::WriteInt32(8, this->export_num(), output);
   }
 
   if (_internal_metadata_.have_unknown_fields()) {
@@ -437,33 +462,38 @@ void System_setting::SerializeWithCachedSizes(
   }
 
   // optional int32 terminor_port = 2 [default = 30000];
-  if (cached_has_bits & 0x00000008u) {
+  if (cached_has_bits & 0x00000010u) {
     target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->terminor_port(), target);
   }
 
   // optional int32 park_space_port = 3 [default = 30001];
-  if (cached_has_bits & 0x00000010u) {
+  if (cached_has_bits & 0x00000020u) {
     target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->park_space_port(), target);
   }
 
   // optional int32 measurer_port = 4 [default = 30002];
-  if (cached_has_bits & 0x00000020u) {
+  if (cached_has_bits & 0x00000040u) {
     target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->measurer_port(), target);
   }
 
   // optional int32 dispatcher_port = 5 [default = 30003];
-  if (cached_has_bits & 0x00000040u) {
+  if (cached_has_bits & 0x00000080u) {
     target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(5, this->dispatcher_port(), target);
   }
 
-  // required int32 entrance_num = 6;
+  // optional int32 exception_handle_port = 6 [default = 3004];
+  if (cached_has_bits & 0x00000008u) {
+    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(6, this->exception_handle_port(), target);
+  }
+
+  // required int32 entrance_num = 7;
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(6, this->entrance_num(), target);
+    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(7, this->entrance_num(), target);
   }
 
-  // required int32 export_num = 7;
+  // required int32 export_num = 8;
   if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(7, this->export_num(), target);
+    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(8, this->export_num(), target);
   }
 
   if (_internal_metadata_.have_unknown_fields()) {
@@ -486,14 +516,14 @@ size_t System_setting::RequiredFieldsByteSizeFallback() const {
   }
 
   if (has_entrance_num()) {
-    // required int32 entrance_num = 6;
+    // required int32 entrance_num = 7;
     total_size += 1 +
       ::google::protobuf::internal::WireFormatLite::Int32Size(
         this->entrance_num());
   }
 
   if (has_export_num()) {
-    // required int32 export_num = 7;
+    // required int32 export_num = 8;
     total_size += 1 +
       ::google::protobuf::internal::WireFormatLite::Int32Size(
         this->export_num());
@@ -516,12 +546,12 @@ size_t System_setting::ByteSizeLong() const {
       ::google::protobuf::internal::WireFormatLite::StringSize(
         this->bind_ip());
 
-    // required int32 entrance_num = 6;
+    // required int32 entrance_num = 7;
     total_size += 1 +
       ::google::protobuf::internal::WireFormatLite::Int32Size(
         this->entrance_num());
 
-    // required int32 export_num = 7;
+    // required int32 export_num = 8;
     total_size += 1 +
       ::google::protobuf::internal::WireFormatLite::Int32Size(
         this->export_num());
@@ -529,7 +559,14 @@ size_t System_setting::ByteSizeLong() const {
   } else {
     total_size += RequiredFieldsByteSizeFallback();
   }
-  if (_has_bits_[0 / 32] & 120u) {
+  if (_has_bits_[0 / 32] & 248u) {
+    // optional int32 exception_handle_port = 6 [default = 3004];
+    if (has_exception_handle_port()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::Int32Size(
+          this->exception_handle_port());
+    }
+
     // optional int32 terminor_port = 2 [default = 30000];
     if (has_terminor_port()) {
       total_size += 1 +
@@ -589,7 +626,7 @@ void System_setting::MergeFrom(const System_setting& from) {
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 127u) {
+  if (cached_has_bits & 255u) {
     if (cached_has_bits & 0x00000001u) {
       set_has_bind_ip();
       bind_ip_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.bind_ip_);
@@ -601,15 +638,18 @@ void System_setting::MergeFrom(const System_setting& from) {
       export_num_ = from.export_num_;
     }
     if (cached_has_bits & 0x00000008u) {
-      terminor_port_ = from.terminor_port_;
+      exception_handle_port_ = from.exception_handle_port_;
     }
     if (cached_has_bits & 0x00000010u) {
-      park_space_port_ = from.park_space_port_;
+      terminor_port_ = from.terminor_port_;
     }
     if (cached_has_bits & 0x00000020u) {
-      measurer_port_ = from.measurer_port_;
+      park_space_port_ = from.park_space_port_;
     }
     if (cached_has_bits & 0x00000040u) {
+      measurer_port_ = from.measurer_port_;
+    }
+    if (cached_has_bits & 0x00000080u) {
       dispatcher_port_ = from.dispatcher_port_;
     }
     _has_bits_[0] |= cached_has_bits;
@@ -644,6 +684,7 @@ void System_setting::InternalSwap(System_setting* other) {
   bind_ip_.Swap(&other->bind_ip_);
   swap(entrance_num_, other->entrance_num_);
   swap(export_num_, other->export_num_);
+  swap(exception_handle_port_, other->exception_handle_port_);
   swap(terminor_port_, other->terminor_port_);
   swap(park_space_port_, other->park_space_port_);
   swap(measurer_port_, other->measurer_port_);

+ 52 - 18
system/system_setting.pb.h

@@ -161,20 +161,27 @@ class System_setting : public ::google::protobuf::Message /* @@protoc_insertion_
   ::std::string* release_bind_ip();
   void set_allocated_bind_ip(::std::string* bind_ip);
 
-  // required int32 entrance_num = 6;
+  // required int32 entrance_num = 7;
   bool has_entrance_num() const;
   void clear_entrance_num();
-  static const int kEntranceNumFieldNumber = 6;
+  static const int kEntranceNumFieldNumber = 7;
   ::google::protobuf::int32 entrance_num() const;
   void set_entrance_num(::google::protobuf::int32 value);
 
-  // required int32 export_num = 7;
+  // required int32 export_num = 8;
   bool has_export_num() const;
   void clear_export_num();
-  static const int kExportNumFieldNumber = 7;
+  static const int kExportNumFieldNumber = 8;
   ::google::protobuf::int32 export_num() const;
   void set_export_num(::google::protobuf::int32 value);
 
+  // optional int32 exception_handle_port = 6 [default = 3004];
+  bool has_exception_handle_port() const;
+  void clear_exception_handle_port();
+  static const int kExceptionHandlePortFieldNumber = 6;
+  ::google::protobuf::int32 exception_handle_port() const;
+  void set_exception_handle_port(::google::protobuf::int32 value);
+
   // optional int32 terminor_port = 2 [default = 30000];
   bool has_terminor_port() const;
   void clear_terminor_port();
@@ -215,6 +222,8 @@ class System_setting : public ::google::protobuf::Message /* @@protoc_insertion_
   void clear_has_measurer_port();
   void set_has_dispatcher_port();
   void clear_has_dispatcher_port();
+  void set_has_exception_handle_port();
+  void clear_has_exception_handle_port();
   void set_has_entrance_num();
   void clear_has_entrance_num();
   void set_has_export_num();
@@ -229,6 +238,7 @@ class System_setting : public ::google::protobuf::Message /* @@protoc_insertion_
   ::google::protobuf::internal::ArenaStringPtr bind_ip_;
   ::google::protobuf::int32 entrance_num_;
   ::google::protobuf::int32 export_num_;
+  ::google::protobuf::int32 exception_handle_port_;
   ::google::protobuf::int32 terminor_port_;
   ::google::protobuf::int32 park_space_port_;
   ::google::protobuf::int32 measurer_port_;
@@ -312,13 +322,13 @@ inline void System_setting::set_allocated_bind_ip(::std::string* bind_ip) {
 
 // optional int32 terminor_port = 2 [default = 30000];
 inline bool System_setting::has_terminor_port() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
+  return (_has_bits_[0] & 0x00000010u) != 0;
 }
 inline void System_setting::set_has_terminor_port() {
-  _has_bits_[0] |= 0x00000008u;
+  _has_bits_[0] |= 0x00000010u;
 }
 inline void System_setting::clear_has_terminor_port() {
-  _has_bits_[0] &= ~0x00000008u;
+  _has_bits_[0] &= ~0x00000010u;
 }
 inline void System_setting::clear_terminor_port() {
   terminor_port_ = 30000;
@@ -336,13 +346,13 @@ inline void System_setting::set_terminor_port(::google::protobuf::int32 value) {
 
 // optional int32 park_space_port = 3 [default = 30001];
 inline bool System_setting::has_park_space_port() const {
-  return (_has_bits_[0] & 0x00000010u) != 0;
+  return (_has_bits_[0] & 0x00000020u) != 0;
 }
 inline void System_setting::set_has_park_space_port() {
-  _has_bits_[0] |= 0x00000010u;
+  _has_bits_[0] |= 0x00000020u;
 }
 inline void System_setting::clear_has_park_space_port() {
-  _has_bits_[0] &= ~0x00000010u;
+  _has_bits_[0] &= ~0x00000020u;
 }
 inline void System_setting::clear_park_space_port() {
   park_space_port_ = 30001;
@@ -360,13 +370,13 @@ inline void System_setting::set_park_space_port(::google::protobuf::int32 value)
 
 // optional int32 measurer_port = 4 [default = 30002];
 inline bool System_setting::has_measurer_port() const {
-  return (_has_bits_[0] & 0x00000020u) != 0;
+  return (_has_bits_[0] & 0x00000040u) != 0;
 }
 inline void System_setting::set_has_measurer_port() {
-  _has_bits_[0] |= 0x00000020u;
+  _has_bits_[0] |= 0x00000040u;
 }
 inline void System_setting::clear_has_measurer_port() {
-  _has_bits_[0] &= ~0x00000020u;
+  _has_bits_[0] &= ~0x00000040u;
 }
 inline void System_setting::clear_measurer_port() {
   measurer_port_ = 30002;
@@ -384,13 +394,13 @@ inline void System_setting::set_measurer_port(::google::protobuf::int32 value) {
 
 // optional int32 dispatcher_port = 5 [default = 30003];
 inline bool System_setting::has_dispatcher_port() const {
-  return (_has_bits_[0] & 0x00000040u) != 0;
+  return (_has_bits_[0] & 0x00000080u) != 0;
 }
 inline void System_setting::set_has_dispatcher_port() {
-  _has_bits_[0] |= 0x00000040u;
+  _has_bits_[0] |= 0x00000080u;
 }
 inline void System_setting::clear_has_dispatcher_port() {
-  _has_bits_[0] &= ~0x00000040u;
+  _has_bits_[0] &= ~0x00000080u;
 }
 inline void System_setting::clear_dispatcher_port() {
   dispatcher_port_ = 30003;
@@ -406,7 +416,31 @@ inline void System_setting::set_dispatcher_port(::google::protobuf::int32 value)
   // @@protoc_insertion_point(field_set:setting.System_setting.dispatcher_port)
 }
 
-// required int32 entrance_num = 6;
+// optional int32 exception_handle_port = 6 [default = 3004];
+inline bool System_setting::has_exception_handle_port() const {
+  return (_has_bits_[0] & 0x00000008u) != 0;
+}
+inline void System_setting::set_has_exception_handle_port() {
+  _has_bits_[0] |= 0x00000008u;
+}
+inline void System_setting::clear_has_exception_handle_port() {
+  _has_bits_[0] &= ~0x00000008u;
+}
+inline void System_setting::clear_exception_handle_port() {
+  exception_handle_port_ = 3004;
+  clear_has_exception_handle_port();
+}
+inline ::google::protobuf::int32 System_setting::exception_handle_port() const {
+  // @@protoc_insertion_point(field_get:setting.System_setting.exception_handle_port)
+  return exception_handle_port_;
+}
+inline void System_setting::set_exception_handle_port(::google::protobuf::int32 value) {
+  set_has_exception_handle_port();
+  exception_handle_port_ = value;
+  // @@protoc_insertion_point(field_set:setting.System_setting.exception_handle_port)
+}
+
+// required int32 entrance_num = 7;
 inline bool System_setting::has_entrance_num() const {
   return (_has_bits_[0] & 0x00000002u) != 0;
 }
@@ -430,7 +464,7 @@ inline void System_setting::set_entrance_num(::google::protobuf::int32 value) {
   // @@protoc_insertion_point(field_set:setting.System_setting.entrance_num)
 }
 
-// required int32 export_num = 7;
+// required int32 export_num = 8;
 inline bool System_setting::has_export_num() const {
   return (_has_bits_[0] & 0x00000004u) != 0;
 }

+ 3 - 2
system/system_setting.proto

@@ -8,7 +8,8 @@ message System_setting
     optional int32          park_space_port=3 [default=30001];
     optional int32          measurer_port=4 [default=30002];
     optional int32          dispatcher_port=5 [default=30003];
+    optional int32          exception_handle_port=6 [default=3004];
 
-    required int32          entrance_num=6;
-    required int32          export_num=7;
+    required int32          entrance_num=7;
+    required int32          export_num=8;
 }

+ 6 - 1
test/store_terminal.cpp

@@ -59,7 +59,12 @@ Error_manager store_terminal::storing(message::Car_info& car_info)
     code=Terminal_communication::get_instance_pointer()->store_request(request,response);
     if(code!=SUCCESS)
     {
-        std::cout<<"  request_error: "<<code.to_string()<<std::endl;
+        LOG(WARNING)<<"  request_error: "<<code.to_string()<<std::endl;
+        return ERROR;
+    }
+    if(response.code().error_code()!=0)
+    {
+        LOG(WARNING)<<" store request response code error: "<<response.code().error_description();
         return ERROR;
     }
     //等待停车完成