Ver Fonte

20210329, 调度流程

huli há 4 anos atrás
pai
commit
cdbd6995cc

+ 2 - 1
dispatch/carrier.cpp

@@ -119,7 +119,8 @@ Error_manager Carrier::update_device_communication()
 	Dispatch_communication::Carrier_request_from_dispatch_to_plc_for_key * tp_carrier_request_from_dispatch_to_plc_for_key =
 	& Dispatch_communication::get_instance_references().m_carrier_request_from_dispatch_to_plc_for_key[m_device_id];
 	memset(tp_carrier_request_from_dispatch_to_plc_for_key->m_request_key, 0, 50);
-	memcpy(tp_carrier_request_from_dispatch_to_plc_for_key->m_request_key, m_request_key.c_str(), m_request_key.size());
+	int t_size = m_request_key.size()<=50 ? m_request_key.size() : 50 ;
+	memcpy(tp_carrier_request_from_dispatch_to_plc_for_key->m_request_key, m_request_key.c_str(), t_size);
 	tp_carrier_request_from_dispatch_to_plc_for_data->m_request_x = m_request_x;
 	tp_carrier_request_from_dispatch_to_plc_for_data->m_request_y = m_request_y;
 	tp_carrier_request_from_dispatch_to_plc_for_data->m_request_z = m_request_z;

+ 2 - 1
dispatch/catcher.cpp

@@ -115,7 +115,8 @@ Error_manager Catcher::update_device_communication()
 	Dispatch_communication::Catcher_request_from_dispatch_to_plc_for_key * tp_catcher_request_from_dispatch_to_plc_for_key =
 	& Dispatch_communication::get_instance_references().m_catcher_request_from_dispatch_to_plc_for_key[m_device_id];
 	memset(tp_catcher_request_from_dispatch_to_plc_for_key->m_request_key, 0, 50);
-	memcpy(tp_catcher_request_from_dispatch_to_plc_for_key->m_request_key, m_request_key.c_str(), m_request_key.size());
+	int t_size = m_request_key.size()<=50 ? m_request_key.size() : 50 ;
+	memcpy(tp_catcher_request_from_dispatch_to_plc_for_key->m_request_key, m_request_key.c_str(), t_size);
 	tp_catcher_request_from_dispatch_to_plc_for_data->m_request_x = m_request_x;
 	tp_catcher_request_from_dispatch_to_plc_for_data->m_request_y = m_request_y;
 	tp_catcher_request_from_dispatch_to_plc_for_data->m_request_b = m_request_b;

+ 6 - 0
dispatch/dispatch_coordinates.cpp

@@ -113,5 +113,11 @@ Error_manager Dispatch_coordinates::dispatch_coordinates_init_from_protobuf(Disp
 	std::cout << " huli test :::: " << " m_carrier_coordinates.size() = " << m_carrier_coordinates.size() << std::endl;
 	std::cout << " huli test :::: " << " m_catcher_coordinates.size() = " << m_catcher_coordinates.size() << std::endl;
 
+	m_default_wheelbase = dispatch_coordinates_parameter_all.default_wheelbase();
+	m_catcher_1th_floor_z = dispatch_coordinates_parameter_all.catcher_1th_floor_z();
+	m_catcher_2th_floor_z = dispatch_coordinates_parameter_all.catcher_2th_floor_z();
+	m_catcher_3th_floor_z = dispatch_coordinates_parameter_all.catcher_3th_floor_z();
+	m_catcher_4th_floor_z = dispatch_coordinates_parameter_all.catcher_4th_floor_z();
+	m_catcher_d1_d2_distance = dispatch_coordinates_parameter_all.catcher_d1_d2_distance();
 	return Error_code::SUCCESS;
 }

+ 8 - 0
dispatch/dispatch_coordinates.h

@@ -71,6 +71,14 @@ public://member variable
 	float									m_catcher_d2_max;
 
 
+	float 									m_default_wheelbase;		//默认轴距
+
+	float 									m_catcher_1th_floor_z;			//机器手在1楼的z周高度
+	float 									m_catcher_2th_floor_z;
+	float 									m_catcher_3th_floor_z;
+	float 									m_catcher_4th_floor_z;
+
+	float									m_catcher_d1_d2_distance;		//机器手2D1-2D2零位间距1903mm
 private:
 
 };

+ 251 - 9
dispatch/dispatch_parameter.pb.cc

@@ -496,6 +496,12 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUT
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Dispatch_proto::Dispatch_coordinates_parameter_all, catcher_d1_max_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Dispatch_proto::Dispatch_coordinates_parameter_all, catcher_d2_min_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Dispatch_proto::Dispatch_coordinates_parameter_all, catcher_d2_max_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Dispatch_proto::Dispatch_coordinates_parameter_all, default_wheelbase_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Dispatch_proto::Dispatch_coordinates_parameter_all, catcher_1th_floor_z_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Dispatch_proto::Dispatch_coordinates_parameter_all, catcher_2th_floor_z_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Dispatch_proto::Dispatch_coordinates_parameter_all, catcher_3th_floor_z_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Dispatch_proto::Dispatch_coordinates_parameter_all, catcher_4th_floor_z_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Dispatch_proto::Dispatch_coordinates_parameter_all, catcher_d1_d2_distance_),
   ~0u,
   ~0u,
   ~0u,
@@ -508,6 +514,12 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUT
   5,
   6,
   7,
+  8,
+  9,
+  10,
+  11,
+  12,
+  13,
 };
 static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
   { 0, 6, sizeof(::Dispatch_proto::Catcher_parameter)},
@@ -521,7 +533,7 @@ static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROT
   { 90, 101, sizeof(::Dispatch_proto::Carrier_box_parameter)},
   { 107, 118, sizeof(::Dispatch_proto::Catcher_box_parameter)},
   { 124, 131, sizeof(::Dispatch_proto::Axis_range_parameter)},
-  { 133, 150, sizeof(::Dispatch_proto::Dispatch_coordinates_parameter_all)},
+  { 133, 156, sizeof(::Dispatch_proto::Dispatch_coordinates_parameter_all)},
 };
 
 static ::google::protobuf::Message const * const file_default_instances[] = {
@@ -591,7 +603,7 @@ void AddDescriptorsImpl() {
       "\004 \001(\005:\0071000000\022\027\n\005z_min\030\005 \001(\005:\010-1000000\022"
       "\026\n\005z_max\030\006 \001(\005:\0071000000\"C\n\024Axis_range_pa"
       "rameter\022\025\n\003min\030\001 \001(\005:\010-1000000\022\024\n\003max\030\002 "
-      "\001(\005:\0071000000\"\246\005\n\"Dispatch_coordinates_pa"
+      "\001(\005:\0071000000\"\325\006\n\"Dispatch_coordinates_pa"
       "rameter_all\022Y\n packspace_coordinates_par"
       "ameters\030\001 \003(\0132/.Dispatch_proto.Packspace"
       "_coordinates_parameter\022[\n!passageway_coo"
@@ -608,10 +620,14 @@ void AddDescriptorsImpl() {
       "er_b_min\030\007 \001(\005\022\025\n\rcatcher_b_max\030\010 \001(\005\022\026\n"
       "\016catcher_d1_min\030\t \001(\005\022\026\n\016catcher_d1_max\030"
       "\n \001(\005\022\026\n\016catcher_d2_min\030\013 \001(\005\022\026\n\016catcher"
-      "_d2_max\030\014 \001(\005"
+      "_d2_max\030\014 \001(\005\022\031\n\021default_wheelbase\030\r \001(\005"
+      "\022\033\n\023catcher_1th_floor_z\030\016 \001(\005\022\033\n\023catcher"
+      "_2th_floor_z\030\017 \001(\005\022\033\n\023catcher_3th_floor_"
+      "z\030\020 \001(\005\022\033\n\023catcher_4th_floor_z\030\021 \001(\005\022\036\n\026"
+      "catcher_d1_d2_distance\030\022 \001(\005"
   };
   ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
-      descriptor, 1893);
+      descriptor, 2068);
   ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
     "dispatch_parameter.proto", &protobuf_RegisterTypes);
 }
@@ -4506,6 +4522,12 @@ const int Dispatch_coordinates_parameter_all::kCatcherD1MinFieldNumber;
 const int Dispatch_coordinates_parameter_all::kCatcherD1MaxFieldNumber;
 const int Dispatch_coordinates_parameter_all::kCatcherD2MinFieldNumber;
 const int Dispatch_coordinates_parameter_all::kCatcherD2MaxFieldNumber;
+const int Dispatch_coordinates_parameter_all::kDefaultWheelbaseFieldNumber;
+const int Dispatch_coordinates_parameter_all::kCatcher1ThFloorZFieldNumber;
+const int Dispatch_coordinates_parameter_all::kCatcher2ThFloorZFieldNumber;
+const int Dispatch_coordinates_parameter_all::kCatcher3ThFloorZFieldNumber;
+const int Dispatch_coordinates_parameter_all::kCatcher4ThFloorZFieldNumber;
+const int Dispatch_coordinates_parameter_all::kCatcherD1D2DistanceFieldNumber;
 #endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
 
 Dispatch_coordinates_parameter_all::Dispatch_coordinates_parameter_all()
@@ -4537,16 +4559,16 @@ Dispatch_coordinates_parameter_all::Dispatch_coordinates_parameter_all(const Dis
     catcher_box_parameters_ = NULL;
   }
   ::memcpy(&catcher_b_min_, &from.catcher_b_min_,
-    static_cast<size_t>(reinterpret_cast<char*>(&catcher_d2_max_) -
-    reinterpret_cast<char*>(&catcher_b_min_)) + sizeof(catcher_d2_max_));
+    static_cast<size_t>(reinterpret_cast<char*>(&catcher_d1_d2_distance_) -
+    reinterpret_cast<char*>(&catcher_b_min_)) + sizeof(catcher_d1_d2_distance_));
   // @@protoc_insertion_point(copy_constructor:Dispatch_proto.Dispatch_coordinates_parameter_all)
 }
 
 void Dispatch_coordinates_parameter_all::SharedCtor() {
   _cached_size_ = 0;
   ::memset(&carrier_box_parameters_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&catcher_d2_max_) -
-      reinterpret_cast<char*>(&carrier_box_parameters_)) + sizeof(catcher_d2_max_));
+      reinterpret_cast<char*>(&catcher_d1_d2_distance_) -
+      reinterpret_cast<char*>(&carrier_box_parameters_)) + sizeof(catcher_d1_d2_distance_));
 }
 
 Dispatch_coordinates_parameter_all::~Dispatch_coordinates_parameter_all() {
@@ -4608,6 +4630,11 @@ void Dispatch_coordinates_parameter_all::Clear() {
         reinterpret_cast<char*>(&catcher_d2_max_) -
         reinterpret_cast<char*>(&catcher_b_min_)) + sizeof(catcher_d2_max_));
   }
+  if (cached_has_bits & 16128u) {
+    ::memset(&default_wheelbase_, 0, static_cast<size_t>(
+        reinterpret_cast<char*>(&catcher_d1_d2_distance_) -
+        reinterpret_cast<char*>(&default_wheelbase_)) + sizeof(catcher_d1_d2_distance_));
+  }
   _has_bits_.Clear();
   _internal_metadata_.Clear();
 }
@@ -4618,7 +4645,7 @@ bool Dispatch_coordinates_parameter_all::MergePartialFromCodedStream(
   ::google::protobuf::uint32 tag;
   // @@protoc_insertion_point(parse_start:Dispatch_proto.Dispatch_coordinates_parameter_all)
   for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
+    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u);
     tag = p.first;
     if (!p.second) goto handle_unusual;
     switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
@@ -4774,6 +4801,90 @@ bool Dispatch_coordinates_parameter_all::MergePartialFromCodedStream(
         break;
       }
 
+      // optional int32 default_wheelbase = 13;
+      case 13: {
+        if (static_cast< ::google::protobuf::uint8>(tag) ==
+            static_cast< ::google::protobuf::uint8>(104u /* 104 & 0xFF */)) {
+          set_has_default_wheelbase();
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
+                 input, &default_wheelbase_)));
+        } else {
+          goto handle_unusual;
+        }
+        break;
+      }
+
+      // optional int32 catcher_1th_floor_z = 14;
+      case 14: {
+        if (static_cast< ::google::protobuf::uint8>(tag) ==
+            static_cast< ::google::protobuf::uint8>(112u /* 112 & 0xFF */)) {
+          set_has_catcher_1th_floor_z();
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
+                 input, &catcher_1th_floor_z_)));
+        } else {
+          goto handle_unusual;
+        }
+        break;
+      }
+
+      // optional int32 catcher_2th_floor_z = 15;
+      case 15: {
+        if (static_cast< ::google::protobuf::uint8>(tag) ==
+            static_cast< ::google::protobuf::uint8>(120u /* 120 & 0xFF */)) {
+          set_has_catcher_2th_floor_z();
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
+                 input, &catcher_2th_floor_z_)));
+        } else {
+          goto handle_unusual;
+        }
+        break;
+      }
+
+      // optional int32 catcher_3th_floor_z = 16;
+      case 16: {
+        if (static_cast< ::google::protobuf::uint8>(tag) ==
+            static_cast< ::google::protobuf::uint8>(128u /* 128 & 0xFF */)) {
+          set_has_catcher_3th_floor_z();
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
+                 input, &catcher_3th_floor_z_)));
+        } else {
+          goto handle_unusual;
+        }
+        break;
+      }
+
+      // optional int32 catcher_4th_floor_z = 17;
+      case 17: {
+        if (static_cast< ::google::protobuf::uint8>(tag) ==
+            static_cast< ::google::protobuf::uint8>(136u /* 136 & 0xFF */)) {
+          set_has_catcher_4th_floor_z();
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
+                 input, &catcher_4th_floor_z_)));
+        } else {
+          goto handle_unusual;
+        }
+        break;
+      }
+
+      // optional int32 catcher_d1_d2_distance = 18;
+      case 18: {
+        if (static_cast< ::google::protobuf::uint8>(tag) ==
+            static_cast< ::google::protobuf::uint8>(144u /* 144 & 0xFF */)) {
+          set_has_catcher_d1_d2_distance();
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
+                 input, &catcher_d1_d2_distance_)));
+        } else {
+          goto handle_unusual;
+        }
+        break;
+      }
+
       default: {
       handle_unusual:
         if (tag == 0) {
@@ -4871,6 +4982,36 @@ void Dispatch_coordinates_parameter_all::SerializeWithCachedSizes(
     ::google::protobuf::internal::WireFormatLite::WriteInt32(12, this->catcher_d2_max(), output);
   }
 
+  // optional int32 default_wheelbase = 13;
+  if (cached_has_bits & 0x00000100u) {
+    ::google::protobuf::internal::WireFormatLite::WriteInt32(13, this->default_wheelbase(), output);
+  }
+
+  // optional int32 catcher_1th_floor_z = 14;
+  if (cached_has_bits & 0x00000200u) {
+    ::google::protobuf::internal::WireFormatLite::WriteInt32(14, this->catcher_1th_floor_z(), output);
+  }
+
+  // optional int32 catcher_2th_floor_z = 15;
+  if (cached_has_bits & 0x00000400u) {
+    ::google::protobuf::internal::WireFormatLite::WriteInt32(15, this->catcher_2th_floor_z(), output);
+  }
+
+  // optional int32 catcher_3th_floor_z = 16;
+  if (cached_has_bits & 0x00000800u) {
+    ::google::protobuf::internal::WireFormatLite::WriteInt32(16, this->catcher_3th_floor_z(), output);
+  }
+
+  // optional int32 catcher_4th_floor_z = 17;
+  if (cached_has_bits & 0x00001000u) {
+    ::google::protobuf::internal::WireFormatLite::WriteInt32(17, this->catcher_4th_floor_z(), output);
+  }
+
+  // optional int32 catcher_d1_d2_distance = 18;
+  if (cached_has_bits & 0x00002000u) {
+    ::google::protobuf::internal::WireFormatLite::WriteInt32(18, this->catcher_d1_d2_distance(), output);
+  }
+
   if (_internal_metadata_.have_unknown_fields()) {
     ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
         _internal_metadata_.unknown_fields(), output);
@@ -4962,6 +5103,36 @@ void Dispatch_coordinates_parameter_all::SerializeWithCachedSizes(
     target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(12, this->catcher_d2_max(), target);
   }
 
+  // optional int32 default_wheelbase = 13;
+  if (cached_has_bits & 0x00000100u) {
+    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(13, this->default_wheelbase(), target);
+  }
+
+  // optional int32 catcher_1th_floor_z = 14;
+  if (cached_has_bits & 0x00000200u) {
+    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(14, this->catcher_1th_floor_z(), target);
+  }
+
+  // optional int32 catcher_2th_floor_z = 15;
+  if (cached_has_bits & 0x00000400u) {
+    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(15, this->catcher_2th_floor_z(), target);
+  }
+
+  // optional int32 catcher_3th_floor_z = 16;
+  if (cached_has_bits & 0x00000800u) {
+    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(16, this->catcher_3th_floor_z(), target);
+  }
+
+  // optional int32 catcher_4th_floor_z = 17;
+  if (cached_has_bits & 0x00001000u) {
+    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(17, this->catcher_4th_floor_z(), target);
+  }
+
+  // optional int32 catcher_d1_d2_distance = 18;
+  if (cached_has_bits & 0x00002000u) {
+    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(18, this->catcher_d1_d2_distance(), target);
+  }
+
   if (_internal_metadata_.have_unknown_fields()) {
     target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
         _internal_metadata_.unknown_fields(), target);
@@ -5080,6 +5251,50 @@ size_t Dispatch_coordinates_parameter_all::ByteSizeLong() const {
           this->catcher_d2_max());
     }
 
+  }
+  if (_has_bits_[8 / 32] & 16128u) {
+    // optional int32 default_wheelbase = 13;
+    if (has_default_wheelbase()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::Int32Size(
+          this->default_wheelbase());
+    }
+
+    // optional int32 catcher_1th_floor_z = 14;
+    if (has_catcher_1th_floor_z()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::Int32Size(
+          this->catcher_1th_floor_z());
+    }
+
+    // optional int32 catcher_2th_floor_z = 15;
+    if (has_catcher_2th_floor_z()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::Int32Size(
+          this->catcher_2th_floor_z());
+    }
+
+    // optional int32 catcher_3th_floor_z = 16;
+    if (has_catcher_3th_floor_z()) {
+      total_size += 2 +
+        ::google::protobuf::internal::WireFormatLite::Int32Size(
+          this->catcher_3th_floor_z());
+    }
+
+    // optional int32 catcher_4th_floor_z = 17;
+    if (has_catcher_4th_floor_z()) {
+      total_size += 2 +
+        ::google::protobuf::internal::WireFormatLite::Int32Size(
+          this->catcher_4th_floor_z());
+    }
+
+    // optional int32 catcher_d1_d2_distance = 18;
+    if (has_catcher_d1_d2_distance()) {
+      total_size += 2 +
+        ::google::protobuf::internal::WireFormatLite::Int32Size(
+          this->catcher_d1_d2_distance());
+    }
+
   }
   int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
   GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
@@ -5142,6 +5357,27 @@ void Dispatch_coordinates_parameter_all::MergeFrom(const Dispatch_coordinates_pa
     }
     _has_bits_[0] |= cached_has_bits;
   }
+  if (cached_has_bits & 16128u) {
+    if (cached_has_bits & 0x00000100u) {
+      default_wheelbase_ = from.default_wheelbase_;
+    }
+    if (cached_has_bits & 0x00000200u) {
+      catcher_1th_floor_z_ = from.catcher_1th_floor_z_;
+    }
+    if (cached_has_bits & 0x00000400u) {
+      catcher_2th_floor_z_ = from.catcher_2th_floor_z_;
+    }
+    if (cached_has_bits & 0x00000800u) {
+      catcher_3th_floor_z_ = from.catcher_3th_floor_z_;
+    }
+    if (cached_has_bits & 0x00001000u) {
+      catcher_4th_floor_z_ = from.catcher_4th_floor_z_;
+    }
+    if (cached_has_bits & 0x00002000u) {
+      catcher_d1_d2_distance_ = from.catcher_d1_d2_distance_;
+    }
+    _has_bits_[0] |= cached_has_bits;
+  }
 }
 
 void Dispatch_coordinates_parameter_all::CopyFrom(const ::google::protobuf::Message& from) {
@@ -5180,6 +5416,12 @@ void Dispatch_coordinates_parameter_all::InternalSwap(Dispatch_coordinates_param
   swap(catcher_d1_max_, other->catcher_d1_max_);
   swap(catcher_d2_min_, other->catcher_d2_min_);
   swap(catcher_d2_max_, other->catcher_d2_max_);
+  swap(default_wheelbase_, other->default_wheelbase_);
+  swap(catcher_1th_floor_z_, other->catcher_1th_floor_z_);
+  swap(catcher_2th_floor_z_, other->catcher_2th_floor_z_);
+  swap(catcher_3th_floor_z_, other->catcher_3th_floor_z_);
+  swap(catcher_4th_floor_z_, other->catcher_4th_floor_z_);
+  swap(catcher_d1_d2_distance_, other->catcher_d1_d2_distance_);
   swap(_has_bits_[0], other->_has_bits_[0]);
   _internal_metadata_.Swap(&other->_internal_metadata_);
   swap(_cached_size_, other->_cached_size_);

+ 204 - 0
dispatch/dispatch_parameter.pb.h

@@ -1822,6 +1822,48 @@ class Dispatch_coordinates_parameter_all : public ::google::protobuf::Message /*
   ::google::protobuf::int32 catcher_d2_max() const;
   void set_catcher_d2_max(::google::protobuf::int32 value);
 
+  // optional int32 default_wheelbase = 13;
+  bool has_default_wheelbase() const;
+  void clear_default_wheelbase();
+  static const int kDefaultWheelbaseFieldNumber = 13;
+  ::google::protobuf::int32 default_wheelbase() const;
+  void set_default_wheelbase(::google::protobuf::int32 value);
+
+  // optional int32 catcher_1th_floor_z = 14;
+  bool has_catcher_1th_floor_z() const;
+  void clear_catcher_1th_floor_z();
+  static const int kCatcher1ThFloorZFieldNumber = 14;
+  ::google::protobuf::int32 catcher_1th_floor_z() const;
+  void set_catcher_1th_floor_z(::google::protobuf::int32 value);
+
+  // optional int32 catcher_2th_floor_z = 15;
+  bool has_catcher_2th_floor_z() const;
+  void clear_catcher_2th_floor_z();
+  static const int kCatcher2ThFloorZFieldNumber = 15;
+  ::google::protobuf::int32 catcher_2th_floor_z() const;
+  void set_catcher_2th_floor_z(::google::protobuf::int32 value);
+
+  // optional int32 catcher_3th_floor_z = 16;
+  bool has_catcher_3th_floor_z() const;
+  void clear_catcher_3th_floor_z();
+  static const int kCatcher3ThFloorZFieldNumber = 16;
+  ::google::protobuf::int32 catcher_3th_floor_z() const;
+  void set_catcher_3th_floor_z(::google::protobuf::int32 value);
+
+  // optional int32 catcher_4th_floor_z = 17;
+  bool has_catcher_4th_floor_z() const;
+  void clear_catcher_4th_floor_z();
+  static const int kCatcher4ThFloorZFieldNumber = 17;
+  ::google::protobuf::int32 catcher_4th_floor_z() const;
+  void set_catcher_4th_floor_z(::google::protobuf::int32 value);
+
+  // optional int32 catcher_d1_d2_distance = 18;
+  bool has_catcher_d1_d2_distance() const;
+  void clear_catcher_d1_d2_distance();
+  static const int kCatcherD1D2DistanceFieldNumber = 18;
+  ::google::protobuf::int32 catcher_d1_d2_distance() const;
+  void set_catcher_d1_d2_distance(::google::protobuf::int32 value);
+
   // @@protoc_insertion_point(class_scope:Dispatch_proto.Dispatch_coordinates_parameter_all)
  private:
   void set_has_carrier_box_parameters();
@@ -1840,6 +1882,18 @@ class Dispatch_coordinates_parameter_all : public ::google::protobuf::Message /*
   void clear_has_catcher_d2_min();
   void set_has_catcher_d2_max();
   void clear_has_catcher_d2_max();
+  void set_has_default_wheelbase();
+  void clear_has_default_wheelbase();
+  void set_has_catcher_1th_floor_z();
+  void clear_has_catcher_1th_floor_z();
+  void set_has_catcher_2th_floor_z();
+  void clear_has_catcher_2th_floor_z();
+  void set_has_catcher_3th_floor_z();
+  void clear_has_catcher_3th_floor_z();
+  void set_has_catcher_4th_floor_z();
+  void clear_has_catcher_4th_floor_z();
+  void set_has_catcher_d1_d2_distance();
+  void clear_has_catcher_d1_d2_distance();
 
   ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
   ::google::protobuf::internal::HasBits<1> _has_bits_;
@@ -1856,6 +1910,12 @@ class Dispatch_coordinates_parameter_all : public ::google::protobuf::Message /*
   ::google::protobuf::int32 catcher_d1_max_;
   ::google::protobuf::int32 catcher_d2_min_;
   ::google::protobuf::int32 catcher_d2_max_;
+  ::google::protobuf::int32 default_wheelbase_;
+  ::google::protobuf::int32 catcher_1th_floor_z_;
+  ::google::protobuf::int32 catcher_2th_floor_z_;
+  ::google::protobuf::int32 catcher_3th_floor_z_;
+  ::google::protobuf::int32 catcher_4th_floor_z_;
+  ::google::protobuf::int32 catcher_d1_d2_distance_;
   friend struct ::protobuf_dispatch_5fparameter_2eproto::TableStruct;
   friend void ::protobuf_dispatch_5fparameter_2eproto::InitDefaultsDispatch_coordinates_parameter_allImpl();
 };
@@ -3240,6 +3300,150 @@ inline void Dispatch_coordinates_parameter_all::set_catcher_d2_max(::google::pro
   // @@protoc_insertion_point(field_set:Dispatch_proto.Dispatch_coordinates_parameter_all.catcher_d2_max)
 }
 
+// optional int32 default_wheelbase = 13;
+inline bool Dispatch_coordinates_parameter_all::has_default_wheelbase() const {
+  return (_has_bits_[0] & 0x00000100u) != 0;
+}
+inline void Dispatch_coordinates_parameter_all::set_has_default_wheelbase() {
+  _has_bits_[0] |= 0x00000100u;
+}
+inline void Dispatch_coordinates_parameter_all::clear_has_default_wheelbase() {
+  _has_bits_[0] &= ~0x00000100u;
+}
+inline void Dispatch_coordinates_parameter_all::clear_default_wheelbase() {
+  default_wheelbase_ = 0;
+  clear_has_default_wheelbase();
+}
+inline ::google::protobuf::int32 Dispatch_coordinates_parameter_all::default_wheelbase() const {
+  // @@protoc_insertion_point(field_get:Dispatch_proto.Dispatch_coordinates_parameter_all.default_wheelbase)
+  return default_wheelbase_;
+}
+inline void Dispatch_coordinates_parameter_all::set_default_wheelbase(::google::protobuf::int32 value) {
+  set_has_default_wheelbase();
+  default_wheelbase_ = value;
+  // @@protoc_insertion_point(field_set:Dispatch_proto.Dispatch_coordinates_parameter_all.default_wheelbase)
+}
+
+// optional int32 catcher_1th_floor_z = 14;
+inline bool Dispatch_coordinates_parameter_all::has_catcher_1th_floor_z() const {
+  return (_has_bits_[0] & 0x00000200u) != 0;
+}
+inline void Dispatch_coordinates_parameter_all::set_has_catcher_1th_floor_z() {
+  _has_bits_[0] |= 0x00000200u;
+}
+inline void Dispatch_coordinates_parameter_all::clear_has_catcher_1th_floor_z() {
+  _has_bits_[0] &= ~0x00000200u;
+}
+inline void Dispatch_coordinates_parameter_all::clear_catcher_1th_floor_z() {
+  catcher_1th_floor_z_ = 0;
+  clear_has_catcher_1th_floor_z();
+}
+inline ::google::protobuf::int32 Dispatch_coordinates_parameter_all::catcher_1th_floor_z() const {
+  // @@protoc_insertion_point(field_get:Dispatch_proto.Dispatch_coordinates_parameter_all.catcher_1th_floor_z)
+  return catcher_1th_floor_z_;
+}
+inline void Dispatch_coordinates_parameter_all::set_catcher_1th_floor_z(::google::protobuf::int32 value) {
+  set_has_catcher_1th_floor_z();
+  catcher_1th_floor_z_ = value;
+  // @@protoc_insertion_point(field_set:Dispatch_proto.Dispatch_coordinates_parameter_all.catcher_1th_floor_z)
+}
+
+// optional int32 catcher_2th_floor_z = 15;
+inline bool Dispatch_coordinates_parameter_all::has_catcher_2th_floor_z() const {
+  return (_has_bits_[0] & 0x00000400u) != 0;
+}
+inline void Dispatch_coordinates_parameter_all::set_has_catcher_2th_floor_z() {
+  _has_bits_[0] |= 0x00000400u;
+}
+inline void Dispatch_coordinates_parameter_all::clear_has_catcher_2th_floor_z() {
+  _has_bits_[0] &= ~0x00000400u;
+}
+inline void Dispatch_coordinates_parameter_all::clear_catcher_2th_floor_z() {
+  catcher_2th_floor_z_ = 0;
+  clear_has_catcher_2th_floor_z();
+}
+inline ::google::protobuf::int32 Dispatch_coordinates_parameter_all::catcher_2th_floor_z() const {
+  // @@protoc_insertion_point(field_get:Dispatch_proto.Dispatch_coordinates_parameter_all.catcher_2th_floor_z)
+  return catcher_2th_floor_z_;
+}
+inline void Dispatch_coordinates_parameter_all::set_catcher_2th_floor_z(::google::protobuf::int32 value) {
+  set_has_catcher_2th_floor_z();
+  catcher_2th_floor_z_ = value;
+  // @@protoc_insertion_point(field_set:Dispatch_proto.Dispatch_coordinates_parameter_all.catcher_2th_floor_z)
+}
+
+// optional int32 catcher_3th_floor_z = 16;
+inline bool Dispatch_coordinates_parameter_all::has_catcher_3th_floor_z() const {
+  return (_has_bits_[0] & 0x00000800u) != 0;
+}
+inline void Dispatch_coordinates_parameter_all::set_has_catcher_3th_floor_z() {
+  _has_bits_[0] |= 0x00000800u;
+}
+inline void Dispatch_coordinates_parameter_all::clear_has_catcher_3th_floor_z() {
+  _has_bits_[0] &= ~0x00000800u;
+}
+inline void Dispatch_coordinates_parameter_all::clear_catcher_3th_floor_z() {
+  catcher_3th_floor_z_ = 0;
+  clear_has_catcher_3th_floor_z();
+}
+inline ::google::protobuf::int32 Dispatch_coordinates_parameter_all::catcher_3th_floor_z() const {
+  // @@protoc_insertion_point(field_get:Dispatch_proto.Dispatch_coordinates_parameter_all.catcher_3th_floor_z)
+  return catcher_3th_floor_z_;
+}
+inline void Dispatch_coordinates_parameter_all::set_catcher_3th_floor_z(::google::protobuf::int32 value) {
+  set_has_catcher_3th_floor_z();
+  catcher_3th_floor_z_ = value;
+  // @@protoc_insertion_point(field_set:Dispatch_proto.Dispatch_coordinates_parameter_all.catcher_3th_floor_z)
+}
+
+// optional int32 catcher_4th_floor_z = 17;
+inline bool Dispatch_coordinates_parameter_all::has_catcher_4th_floor_z() const {
+  return (_has_bits_[0] & 0x00001000u) != 0;
+}
+inline void Dispatch_coordinates_parameter_all::set_has_catcher_4th_floor_z() {
+  _has_bits_[0] |= 0x00001000u;
+}
+inline void Dispatch_coordinates_parameter_all::clear_has_catcher_4th_floor_z() {
+  _has_bits_[0] &= ~0x00001000u;
+}
+inline void Dispatch_coordinates_parameter_all::clear_catcher_4th_floor_z() {
+  catcher_4th_floor_z_ = 0;
+  clear_has_catcher_4th_floor_z();
+}
+inline ::google::protobuf::int32 Dispatch_coordinates_parameter_all::catcher_4th_floor_z() const {
+  // @@protoc_insertion_point(field_get:Dispatch_proto.Dispatch_coordinates_parameter_all.catcher_4th_floor_z)
+  return catcher_4th_floor_z_;
+}
+inline void Dispatch_coordinates_parameter_all::set_catcher_4th_floor_z(::google::protobuf::int32 value) {
+  set_has_catcher_4th_floor_z();
+  catcher_4th_floor_z_ = value;
+  // @@protoc_insertion_point(field_set:Dispatch_proto.Dispatch_coordinates_parameter_all.catcher_4th_floor_z)
+}
+
+// optional int32 catcher_d1_d2_distance = 18;
+inline bool Dispatch_coordinates_parameter_all::has_catcher_d1_d2_distance() const {
+  return (_has_bits_[0] & 0x00002000u) != 0;
+}
+inline void Dispatch_coordinates_parameter_all::set_has_catcher_d1_d2_distance() {
+  _has_bits_[0] |= 0x00002000u;
+}
+inline void Dispatch_coordinates_parameter_all::clear_has_catcher_d1_d2_distance() {
+  _has_bits_[0] &= ~0x00002000u;
+}
+inline void Dispatch_coordinates_parameter_all::clear_catcher_d1_d2_distance() {
+  catcher_d1_d2_distance_ = 0;
+  clear_has_catcher_d1_d2_distance();
+}
+inline ::google::protobuf::int32 Dispatch_coordinates_parameter_all::catcher_d1_d2_distance() const {
+  // @@protoc_insertion_point(field_get:Dispatch_proto.Dispatch_coordinates_parameter_all.catcher_d1_d2_distance)
+  return catcher_d1_d2_distance_;
+}
+inline void Dispatch_coordinates_parameter_all::set_catcher_d1_d2_distance(::google::protobuf::int32 value) {
+  set_has_catcher_d1_d2_distance();
+  catcher_d1_d2_distance_ = value;
+  // @@protoc_insertion_point(field_set:Dispatch_proto.Dispatch_coordinates_parameter_all.catcher_d1_d2_distance)
+}
+
 #ifdef __GNUC__
   #pragma GCC diagnostic pop
 #endif  // __GNUC__

+ 10 - 0
dispatch/dispatch_parameter.proto

@@ -131,7 +131,9 @@ message Dispatch_coordinates_parameter_all
     repeated Carrier_coordinates_parameter              carrier_coordinates_parameters = 3;
     repeated Catcher_coordinates_parameter              catcher_coordinates_parameters = 4;
 
+
     optional Carrier_box_parameter                      carrier_box_parameters = 5;
+
     optional Catcher_box_parameter                      catcher_box_parameters = 6;
     optional int32                                      catcher_b_min = 7;
     optional int32                                      catcher_b_max = 8;
@@ -140,4 +142,12 @@ message Dispatch_coordinates_parameter_all
     optional int32                                      catcher_d2_min = 11;
     optional int32                                      catcher_d2_max = 12;
 
+
+    optional int32                                      default_wheelbase = 13;
+    optional int32                                      catcher_1th_floor_z = 14;
+    optional int32                                      catcher_2th_floor_z = 15;
+    optional int32                                      catcher_3th_floor_z = 16;
+    optional int32                                      catcher_4th_floor_z = 17;
+    optional int32                                      catcher_d1_d2_distance = 18;
+
 }

+ 103 - 77
dispatch/dispatch_process.cpp

@@ -55,9 +55,10 @@ Error_manager Dispatch_process::Dispatch_process_init(message::Dispatch_request_
 	{
 		m_dispatch_process_type = DISPATCH_PROCESS_TYPE_UNKNOW;
 		return Error_manager(Error_code::PARAMETER_ERROR, Error_level::MINOR_ERROR,
-							"  Dispatch_process::Dispatch_process_init ERROR ");
+							 "  Dispatch_process::Dispatch_process_init ERROR ");
 	}
 
+	m_dispatch_request_msg = dispatch_request_msg;
 	m_dispatch_process_status = DISPATCH_PROCESS_CREATED;
 	return Error_code::SUCCESS;
 }
@@ -77,10 +78,10 @@ void Dispatch_process::Main()
 	{
 		std::this_thread::sleep_for(std::chrono::microseconds(1));
 
-	    switch ( m_dispatch_process_status )
-	    {
-	        case DISPATCH_PROCESS_CREATED:
-	        {
+		switch ( m_dispatch_process_status )
+		{
+			case DISPATCH_PROCESS_CREATED:
+			{
 				//检查调度请求
 				m_result = check_dispatch_request_msg();
 				if ( m_result !=Error_code::SUCCESS)
@@ -97,10 +98,10 @@ void Dispatch_process::Main()
 				}
 				//流程正常, 就进入等待状态, 等待调度控制发送动作指令
 				m_dispatch_process_status = DISPATCH_PROCESS_READY;
-	            break;
-	        }
-	        case DISPATCH_PROCESS_READY:
-	        {
+				break;
+			}
+			case DISPATCH_PROCESS_READY:
+			{
 				//等待控制指令
 				m_result = wait_dispatch_control_request_msg();
 				if ( m_result !=Error_code::SUCCESS)
@@ -127,7 +128,7 @@ void Dispatch_process::Main()
 					break;
 				}
 				break;
-	        }
+			}
 			case DISPATCH_PROCESS_CONNECT_DEVICE:
 			{
 				//连接调度设备
@@ -183,12 +184,12 @@ void Dispatch_process::Main()
 			{
 				break;
 			}
-	        default:
-	        {
+			default:
+			{
 
-	            break;
-	        }
-	    }
+				break;
+			}
+		}
 	}
 
 	//任务超时
@@ -236,7 +237,7 @@ Error_manager Dispatch_process::wait_dispatch_control_request_msg()
 	}
 	else
 	{
-	    return Error_code::SUCCESS;
+		return Error_code::SUCCESS;
 	}
 }
 
@@ -280,7 +281,7 @@ Error_manager Dispatch_process::connect_dispatch_device()
 			tp_catcher_task->m_request_z = mp_catcher->m_actual_z;
 			tp_catcher_task->m_request_d1 = mp_catcher->m_actual_d1;
 			tp_catcher_task->m_request_d2 = mp_catcher->m_actual_d2;
-			tp_catcher_task->m_request_wheelbase = 0;
+			tp_catcher_task->m_request_wheelbase = Dispatch_coordinates::get_instance_references().m_default_wheelbase;
 			tp_catcher_task->m_request_clamp_motion = (Catcher_task::Clamp_motion)mp_catcher->m_actual_clamp_motion1;
 
 			t_error = mp_catcher->execute_task(mp_catcher_task, Dispatch_device_base::E_ONE_LEVEL);
@@ -327,9 +328,9 @@ Error_manager Dispatch_process::connect_dispatch_device()
 			m_destination_coordinates = Dispatch_coordinates::get_instance_references().m_catcher_coordinates[m_dispatch_control_request_msg.dispatch_destination()];
 		}
 	}
-	//搬运器的配置 准备工作
+		//搬运器的配置 准备工作
 	else if ( m_dispatch_control_request_msg.dispatch_device_type() >= message::Dispatch_device_type::CARRIER_1 &&
-		 m_dispatch_control_request_msg.dispatch_device_type() <= message::Dispatch_device_type::CARRIER_3 )
+			  m_dispatch_control_request_msg.dispatch_device_type() <= message::Dispatch_device_type::CARRIER_3 )
 	{
 		//找到对应的设备
 		if ( m_dispatch_control_request_msg.dispatch_device_type() == message::Dispatch_device_type::CARRIER_1 )
@@ -367,7 +368,7 @@ Error_manager Dispatch_process::connect_dispatch_device()
 			tp_carrier_task->m_request_joint_motion_y = Carrier_task::Joint_motion::E_JOINT_NO_ACTION;
 			tp_carrier_task->m_request_space_id = 0;
 			tp_carrier_task->m_request_floor_id = 0;
-			tp_carrier_task->m_request_wheelbase = 0;
+			tp_carrier_task->m_request_wheelbase = Dispatch_coordinates::get_instance_references().m_default_wheelbase;
 
 			t_error = mp_carrier->execute_task(mp_catcher_task, Dispatch_device_base::E_ONE_LEVEL);
 			if ( t_error != Error_code::SUCCESS )
@@ -422,24 +423,24 @@ Error_manager Dispatch_process::check_catcher_task()
 {
 	if ( mp_catcher_task.get() == NULL )
 	{
-	    return Error_manager(Error_code::POINTER_IS_NULL, Error_level::MINOR_ERROR,
-	    					"Dispatch_process::check_catcher_task  POINTER IS NULL ");
+		return Error_manager(Error_code::POINTER_IS_NULL, Error_level::MINOR_ERROR,
+							 "Dispatch_process::check_catcher_task  POINTER IS NULL ");
 	}
 	else
 	{
 		Catcher_task * tp_catcher_task = (Catcher_task *)mp_catcher_task.get();
 
 		if ( tp_catcher_task->get_task_statu() == Task_Base::Task_statu::TASK_OVER )
-	    {
+		{
 			return Error_code::SUCCESS;
-	    }
+		}
 		else if ( tp_catcher_task->get_task_statu() == Task_Base::Task_statu::TASK_ERROR )
 		{
 			return tp_catcher_task->get_task_error_manager();
 		}
 		else if ( tp_catcher_task->get_task_statu() == Task_Base::Task_statu::TASK_WORKING &&
-		tp_catcher_task->get_task_statu() == Task_Base::Task_statu::TASK_SIGNED &&
-			tp_catcher_task->get_task_statu() == Task_Base::Task_statu::TASK_CREATED)
+				  tp_catcher_task->get_task_statu() == Task_Base::Task_statu::TASK_SIGNED &&
+				  tp_catcher_task->get_task_statu() == Task_Base::Task_statu::TASK_CREATED)
 		{
 			return Error_code::NODATA;
 		}
@@ -448,12 +449,58 @@ Error_manager Dispatch_process::check_catcher_task()
 //检查搬运器任务单
 Error_manager Dispatch_process::check_carrier_task()
 {
+	if ( mp_carrier_task.get() == NULL )
+	{
+		return Error_manager(Error_code::POINTER_IS_NULL, Error_level::MINOR_ERROR,
+							 "Dispatch_process::check_carrier_task  POINTER IS NULL ");
+	}
+	else
+	{
+		Catcher_task * tp_carrier_task = (Catcher_task *)mp_carrier_task.get();
 
+		if ( tp_carrier_task->get_task_statu() == Task_Base::Task_statu::TASK_OVER )
+		{
+			return Error_code::SUCCESS;
+		}
+		else if ( tp_carrier_task->get_task_statu() == Task_Base::Task_statu::TASK_ERROR )
+		{
+			return tp_carrier_task->get_task_error_manager();
+		}
+		else if ( tp_carrier_task->get_task_statu() == Task_Base::Task_statu::TASK_WORKING &&
+				  tp_carrier_task->get_task_statu() == Task_Base::Task_statu::TASK_SIGNED &&
+				  tp_carrier_task->get_task_statu() == Task_Base::Task_statu::TASK_CREATED)
+		{
+			return Error_code::NODATA;
+		}
+	}
 }
 //检查通道口任务单
 Error_manager Dispatch_process::check_passageway_task()
 {
+	if ( mp_passageway_task.get() == NULL )
+	{
+		return Error_manager(Error_code::POINTER_IS_NULL, Error_level::MINOR_ERROR,
+							 "Dispatch_process::check_passageway_task  POINTER IS NULL ");
+	}
+	else
+	{
+		Catcher_task * tp_passageway_task = (Catcher_task *)mp_passageway_task.get();
 
+		if ( tp_passageway_task->get_task_statu() == Task_Base::Task_statu::TASK_OVER )
+		{
+			return Error_code::SUCCESS;
+		}
+		else if ( tp_passageway_task->get_task_statu() == Task_Base::Task_statu::TASK_ERROR )
+		{
+			return tp_passageway_task->get_task_error_manager();
+		}
+		else if ( tp_passageway_task->get_task_statu() == Task_Base::Task_statu::TASK_WORKING &&
+				  tp_passageway_task->get_task_statu() == Task_Base::Task_statu::TASK_SIGNED &&
+				  tp_passageway_task->get_task_statu() == Task_Base::Task_statu::TASK_CREATED)
+		{
+			return Error_code::NODATA;
+		}
+	}
 }
 
 //执行调度控制指令, 并根据完成情况给答复
@@ -471,65 +518,44 @@ Error_manager Dispatch_process::excute_robot_catch_car_from_inlet()
 
 	//设备的动作也使用外部的Main()的线程来循环
 	static int s_step = 0;
+	Catcher_task * tp_catcher_task = NULL;
 
-	//第一次进入动作时, 创建任务单
-	if ( mp_catcher_task.get() == NULL )
+	if ( mp_catcher.get() == NULL || mp_catcher_task.get() == NULL )
 	{
-		//检查设备状态
-		if ( mp_catcher->check_status() == Error_code::SUCCESS &&
-		mp_catcher->m_actual_device_status == Dispatch_device_base::DEVICE_READY &&
-		mp_catcher->m_actual_load_status == Dispatch_device_base::NO_CAR)
-		{
-			s_step = 0;
-			//创建任务单
-			mp_catcher_task = std::shared_ptr<Task_Base>(new Catcher_task);
-			mp_catcher_task->task_init(NULL,std::chrono::milliseconds(15000));
-			Catcher_task * tp_catcher_task = (Catcher_task *)mp_catcher_task.get();
-
-			tp_catcher_task->m_request_key = "";
-			tp_catcher_task->m_request_x = mp_catcher->m_actual_x;
-			tp_catcher_task->m_request_y = mp_catcher->m_actual_y;
-			tp_catcher_task->m_request_b = mp_catcher->m_actual_b;
-			tp_catcher_task->m_request_z = mp_catcher->m_actual_z;
-			tp_catcher_task->m_request_d1 = mp_catcher->m_actual_d1;
-			tp_catcher_task->m_request_d2 = mp_catcher->m_actual_d2;
-			tp_catcher_task->m_request_wheelbase = 0;
-			tp_catcher_task->m_request_clamp_motion = (Catcher_task::Clamp_motion)mp_catcher->m_actual_clamp_motion1;
+		return Error_manager(Error_code::POINTER_IS_NULL, Error_level::MINOR_ERROR,
+							 "Dispatch_process::excute_robot_catch_car_from_inlet()  POINTER IS NULL ");
+	}
+	else
+	{
+		tp_catcher_task = (Catcher_task *)mp_catcher_task.get();
+	}
 
-			//第一次发送 空的唯一码, 可以和设备建立联系
-			t_error = mp_catcher->execute_task(mp_catcher_task, Dispatch_device_base::E_ONE_LEVEL);
-			if ( t_error != Error_code::SUCCESS )
-			{
-				return t_error;
-			}
+	if ( s_step == 0 )
+	{
+		t_error = check_catcher_task();
+		if ( t_error == Error_code::SUCCESS )
+		{
+			s_step++;//成功完成之后, 并不返回, 直接进入下一步
+		}
+		else if( t_error == Error_code::NODATA )
+		{
+		    //什么也不做, 继续等待任务完成, 此时Main函数会一直循环.
 		}
 		else
 		{
-			return Error_manager(Error_code::DISPATCH_PROCESS_DEVICE_STATUS_ERROR, Error_level::MINOR_ERROR,
-								 " Dispatch_process::excute_robot_catch_car_from_inlet device_status error ");
+			s_step = 0;
+			return t_error;
 		}
-
 	}
-
-	Catcher_task * tp_catcher_task = (Catcher_task *)mp_catcher_task.get();
-
-	switch ( s_step )
+	if ( s_step == 1 )
 	{
-	    case 0://
-	    {
-
-	        break;
-	    }
-	    case 1:
-	    {
-	        ;
-	        break;
-	    }
-	    default:
-	    {
-
-	        break;
-	    }
+		std::unique_lock<std::mutex> t_lock1(m_lock);
+		std::unique_lock<std::mutex> t_lock2(tp_catcher_task->m_lock);
+		char t_key[50] = {0};
+		sprintf(t_key, "%s+%d+%d", m_dispatch_control_request_msg.command_key().c_str(), m_dispatch_control_request_msg.dispatch_task_type(), s_step);
+		tp_catcher_task->m_respons_key = t_key;
+		//机器手z轴移到最高点.
+		tp_catcher_task->m_request_z = Dispatch_coordinates::get_instance_references().m_catcher_4th_floor_z;
 	}
 }
 //机器手把车放到中跑车上面(例如:机器手下降到中跑车上放车,最后上升到最上方)(通过目标点 指定放到哪一个中跑车上)
@@ -541,7 +567,7 @@ Error_manager Dispatch_process::excute_robot_put_car_to_carrier()
 //执行通道口动作
 Error_manager Dispatch_process::excute_passageway_motion()
 {
-return Error_code::SUCCESS;
+	return Error_code::SUCCESS;
 }
 
 //等待调度总计划答复

+ 2 - 1
dispatch/passageway.cpp

@@ -96,7 +96,8 @@ Error_manager Passageway::update_device_communication()
 	Dispatch_communication::Passageway_request_from_dispatch_to_plc_for_key * tp_passageway_request_from_dispatch_to_plc_for_key =
 	& Dispatch_communication::get_instance_references().m_passageway_request_from_dispatch_to_plc_for_key[m_device_id];
 	memset(tp_passageway_request_from_dispatch_to_plc_for_key->m_request_key, 0, 50);
-	memcpy(tp_passageway_request_from_dispatch_to_plc_for_key->m_request_key, m_request_key.c_str(), m_request_key.size());
+	int t_size = m_request_key.size()<=50 ? m_request_key.size() : 50 ;
+	memcpy(tp_passageway_request_from_dispatch_to_plc_for_key->m_request_key, m_request_key.c_str(), t_size);
 	tp_passageway_request_from_dispatch_to_plc_for_data->m_request_inside_door_motion = m_request_inside_door_motion;
 	tp_passageway_request_from_dispatch_to_plc_for_data->m_request_outside_door_motion = m_request_outside_door_motion;
 	tp_passageway_request_from_dispatch_to_plc_for_data->m_request_turntable_direction = m_request_turntable_direction;

+ 6 - 3
setting/dispatch_coordinates.prototxt

@@ -1792,10 +1792,13 @@ catcher_d1_max:650
 catcher_d2_min:0
 catcher_d2_max:650
 
+default_wheelbase:2700
 
-
-
-
+catcher_1th_floor:0
+catcher_2th_floor:2760
+catcher_3th_floor:5360
+catcher_4th_floor:5410
+catcher_d1_d2_distance:1903