Browse Source

增加雷达扫描帧数配置,增加保存文件路径配置,按照日期保存

zx 5 years ago
parent
commit
0d9bb4e4d7

+ 1 - 0
error_code/error_code.h

@@ -142,6 +142,7 @@ enum Error_code
     //System_manager error from 0x04010000-0x0401FFFF
     SYSTEM_READ_PARAMETER_ERROR=0x04010100,
     SYSTEM_PARAMETER_ERROR,
+    SYSTEM_INPUT_TERMINOR_NO_LASERS,
 
     //terminor_command_executor.cpp from 0x04010200-0x040102FF
     TERMINOR_NOT_READY=0x04010200,

+ 29 - 2
system_manager/System_Manager.cpp

@@ -100,6 +100,7 @@ Error_manager System_Manager::init()
     {
         return Error_manager(SYSTEM_READ_PARAMETER_ERROR,NORMAL,"read terminal parameter failed");
     }
+    m_terminal_parameter_all=terminor_parameter_all;
     //第二步,根据配置,创建各个模块
     //创建雷达
     int laser_cout=laser_parameters.laser_parameters_size();
@@ -149,6 +150,7 @@ Error_manager System_Manager::init()
     for(int i=0;i<terminor_count;++i)
     {
         m_terminal_vector[i]=new Terminor_Command_Executor(terminor_parameter_all.terminor_parameters(i));
+        m_terminal_vector[i]->set_save_root_path(terminor_parameter_all.save_root_path());
     }
     //最后创建plc,连接,设置回调
     mp_plc=new Plc_Communicator(plc_parameter);
@@ -166,8 +168,9 @@ Error_manager System_Manager::init()
 //plc指令回调函数,当plc收到测量指令后,调用此回调函数
 //terminal_id:收到指令的终端编号
 //owner:this指针
-Error_manager System_Manager::plc_command_callback(int terminal_id,void* owner)
+Error_manager System_Manager::plc_command_callback(int terminal_id_plc,void* owner)
 {
+    int terminal_id=terminal_id_plc-1;
     Error_manager code;
     LOG(INFO)<<"RECEIVE terminal command , ID : "<<terminal_id;
     //第一步判断输入参数是否合法
@@ -185,7 +188,31 @@ Error_manager System_Manager::plc_command_callback(int terminal_id,void* owner)
     }
     //第二步,根据terminal_id,启动对应terminaor执行指令流程
     //根据配置筛选雷达,当前测试使用所有雷达
-    code=system_manager->m_terminal_vector[terminal_id]->execute_command(system_manager->m_laser_vector,
+    std::vector<Laser_base*> tp_lasers;
+    for(int i=0;i<system_manager->m_terminal_parameter_all.terminor_parameters(terminal_id).laser_parameter_size();++i)
+    {
+        int laser_id=system_manager->m_terminal_parameter_all.terminor_parameters(terminal_id).laser_parameter(i).id();
+        if(laser_id>=0&&laser_id<system_manager->m_laser_vector.size())
+        {
+            //判断该id的雷达是否已经添加进去, 放置配置中出现重复的雷达编号
+            bool tb_repeat=false;
+            for(int j=0;j<tp_lasers.size();++j)
+            {
+                if(tp_lasers[j]==system_manager->m_laser_vector[laser_id])
+                {
+                    tb_repeat=true;
+                    break;
+                }
+            }
+            if(tb_repeat==false)
+                tp_lasers.push_back(system_manager->m_laser_vector[laser_id]);
+        }
+    }
+    if(tp_lasers.size()==0)
+    {
+        return Error_manager(SYSTEM_INPUT_TERMINOR_NO_LASERS,NORMAL,"ternimal command has no laser");
+    }
+    code=system_manager->m_terminal_vector[terminal_id]->execute_command(tp_lasers,
         system_manager->mp_plc,system_manager->mp_locater,10);
     switch(code.get_error_code())
     {

+ 3 - 0
system_manager/System_Manager.h

@@ -36,6 +36,9 @@ protected:
     Locater*                                    mp_locater;
     Plc_Communicator*                           mp_plc;
 
+    ///terminoal 配置
+    Terminal::Terminor_parameter_all            m_terminal_parameter_all;
+
 
 };
 

+ 454 - 11
terminor/Terminor_parameter.pb.cc

@@ -25,6 +25,11 @@ class Area3dDefaultTypeInternal {
   ::google::protobuf::internal::ExplicitlyConstructed<Area3d>
       _instance;
 } _Area3d_default_instance_;
+class Laser_parameterDefaultTypeInternal {
+ public:
+  ::google::protobuf::internal::ExplicitlyConstructed<Laser_parameter>
+      _instance;
+} _Laser_parameter_default_instance_;
 class Terminor_parameterDefaultTypeInternal {
  public:
   ::google::protobuf::internal::ExplicitlyConstructed<Terminor_parameter>
@@ -58,6 +63,27 @@ void InitDefaultsArea3d() {
   ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsArea3dImpl);
 }
 
+void InitDefaultsLaser_parameterImpl() {
+  GOOGLE_PROTOBUF_VERIFY_VERSION;
+
+#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
+  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
+#else
+  ::google::protobuf::internal::InitProtobufDefaults();
+#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
+  {
+    void* ptr = &::Terminal::_Laser_parameter_default_instance_;
+    new (ptr) ::Terminal::Laser_parameter();
+    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
+  }
+  ::Terminal::Laser_parameter::InitAsDefaultInstance();
+}
+
+void InitDefaultsLaser_parameter() {
+  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
+  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsLaser_parameterImpl);
+}
+
 void InitDefaultsTerminor_parameterImpl() {
   GOOGLE_PROTOBUF_VERIFY_VERSION;
 
@@ -67,6 +93,7 @@ void InitDefaultsTerminor_parameterImpl() {
   ::google::protobuf::internal::InitProtobufDefaults();
 #endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
   protobuf_Terminor_5fparameter_2eproto::InitDefaultsArea3d();
+  protobuf_Terminor_5fparameter_2eproto::InitDefaultsLaser_parameter();
   {
     void* ptr = &::Terminal::_Terminor_parameter_default_instance_;
     new (ptr) ::Terminal::Terminor_parameter();
@@ -102,7 +129,7 @@ void InitDefaultsTerminor_parameter_all() {
   ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsTerminor_parameter_allImpl);
 }
 
-::google::protobuf::Metadata file_level_metadata[3];
+::google::protobuf::Metadata file_level_metadata[4];
 
 const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Terminal::Area3d, _has_bits_),
@@ -122,6 +149,15 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUT
   3,
   4,
   5,
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Terminal::Laser_parameter, _has_bits_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Terminal::Laser_parameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Terminal::Laser_parameter, id_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Terminal::Laser_parameter, frame_count_),
+  0,
+  1,
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Terminal::Terminor_parameter, _has_bits_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Terminal::Terminor_parameter, _internal_metadata_),
   ~0u,  // no _extensions_
@@ -129,24 +165,30 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUT
   ~0u,  // no _weak_field_map_
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Terminal::Terminor_parameter, area_3d_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Terminal::Terminor_parameter, id_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Terminal::Terminor_parameter, laser_parameter_),
   0,
   1,
+  ~0u,
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Terminal::Terminor_parameter_all, _has_bits_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Terminal::Terminor_parameter_all, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Terminal::Terminor_parameter_all, terminor_parameters_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Terminal::Terminor_parameter_all, save_root_path_),
   ~0u,
+  0,
 };
 static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
   { 0, 11, sizeof(::Terminal::Area3d)},
-  { 17, 24, sizeof(::Terminal::Terminor_parameter)},
-  { 26, 32, sizeof(::Terminal::Terminor_parameter_all)},
+  { 17, 24, sizeof(::Terminal::Laser_parameter)},
+  { 26, 34, sizeof(::Terminal::Terminor_parameter)},
+  { 37, 44, sizeof(::Terminal::Terminor_parameter_all)},
 };
 
 static ::google::protobuf::Message const * const file_default_instances[] = {
   reinterpret_cast<const ::google::protobuf::Message*>(&::Terminal::_Area3d_default_instance_),
+  reinterpret_cast<const ::google::protobuf::Message*>(&::Terminal::_Laser_parameter_default_instance_),
   reinterpret_cast<const ::google::protobuf::Message*>(&::Terminal::_Terminor_parameter_default_instance_),
   reinterpret_cast<const ::google::protobuf::Message*>(&::Terminal::_Terminor_parameter_all_default_instance_),
 };
@@ -167,7 +209,7 @@ void protobuf_AssignDescriptorsOnce() {
 void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
 void protobuf_RegisterTypes(const ::std::string&) {
   protobuf_AssignDescriptorsOnce();
-  ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 3);
+  ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 4);
 }
 
 void AddDescriptorsImpl() {
@@ -176,14 +218,17 @@ void AddDescriptorsImpl() {
       "\n\030Terminor_parameter.proto\022\010Terminal\"b\n\006"
       "Area3d\022\r\n\005min_x\030\001 \002(\002\022\r\n\005max_x\030\002 \002(\002\022\r\n\005"
       "min_y\030\003 \002(\002\022\r\n\005max_y\030\004 \002(\002\022\r\n\005min_z\030\005 \002("
-      "\002\022\r\n\005max_z\030\006 \002(\002\"C\n\022Terminor_parameter\022!"
-      "\n\007area_3d\030\001 \002(\0132\020.Terminal.Area3d\022\n\n\002id\030"
-      "\002 \002(\003\"S\n\026Terminor_parameter_all\0229\n\023termi"
-      "nor_parameters\030\001 \003(\0132\034.Terminal.Terminor"
-      "_parameter"
+      "\002\022\r\n\005max_z\030\006 \002(\002\"2\n\017Laser_parameter\022\n\n\002i"
+      "d\030\001 \002(\003\022\023\n\013frame_count\030\002 \001(\003\"w\n\022Terminor"
+      "_parameter\022!\n\007area_3d\030\001 \002(\0132\020.Terminal.A"
+      "rea3d\022\n\n\002id\030\002 \002(\003\0222\n\017laser_parameter\030\003 \003"
+      "(\0132\031.Terminal.Laser_parameter\"k\n\026Termino"
+      "r_parameter_all\0229\n\023terminor_parameters\030\001"
+      " \003(\0132\034.Terminal.Terminor_parameter\022\026\n\016sa"
+      "ve_root_path\030\002 \002(\t"
   };
   ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
-      descriptor, 290);
+      descriptor, 418);
   ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
     "Terminor_parameter.proto", &protobuf_RegisterTypes);
 }
@@ -654,6 +699,298 @@ void Area3d::InternalSwap(Area3d* other) {
 }
 
 
+// ===================================================================
+
+void Laser_parameter::InitAsDefaultInstance() {
+}
+#if !defined(_MSC_VER) || _MSC_VER >= 1900
+const int Laser_parameter::kIdFieldNumber;
+const int Laser_parameter::kFrameCountFieldNumber;
+#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
+
+Laser_parameter::Laser_parameter()
+  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
+  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
+    ::protobuf_Terminor_5fparameter_2eproto::InitDefaultsLaser_parameter();
+  }
+  SharedCtor();
+  // @@protoc_insertion_point(constructor:Terminal.Laser_parameter)
+}
+Laser_parameter::Laser_parameter(const Laser_parameter& from)
+  : ::google::protobuf::Message(),
+      _internal_metadata_(NULL),
+      _has_bits_(from._has_bits_),
+      _cached_size_(0) {
+  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  ::memcpy(&id_, &from.id_,
+    static_cast<size_t>(reinterpret_cast<char*>(&frame_count_) -
+    reinterpret_cast<char*>(&id_)) + sizeof(frame_count_));
+  // @@protoc_insertion_point(copy_constructor:Terminal.Laser_parameter)
+}
+
+void Laser_parameter::SharedCtor() {
+  _cached_size_ = 0;
+  ::memset(&id_, 0, static_cast<size_t>(
+      reinterpret_cast<char*>(&frame_count_) -
+      reinterpret_cast<char*>(&id_)) + sizeof(frame_count_));
+}
+
+Laser_parameter::~Laser_parameter() {
+  // @@protoc_insertion_point(destructor:Terminal.Laser_parameter)
+  SharedDtor();
+}
+
+void Laser_parameter::SharedDtor() {
+}
+
+void Laser_parameter::SetCachedSize(int size) const {
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+}
+const ::google::protobuf::Descriptor* Laser_parameter::descriptor() {
+  ::protobuf_Terminor_5fparameter_2eproto::protobuf_AssignDescriptorsOnce();
+  return ::protobuf_Terminor_5fparameter_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+}
+
+const Laser_parameter& Laser_parameter::default_instance() {
+  ::protobuf_Terminor_5fparameter_2eproto::InitDefaultsLaser_parameter();
+  return *internal_default_instance();
+}
+
+Laser_parameter* Laser_parameter::New(::google::protobuf::Arena* arena) const {
+  Laser_parameter* n = new Laser_parameter;
+  if (arena != NULL) {
+    arena->Own(n);
+  }
+  return n;
+}
+
+void Laser_parameter::Clear() {
+// @@protoc_insertion_point(message_clear_start:Terminal.Laser_parameter)
+  ::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) {
+    ::memset(&id_, 0, static_cast<size_t>(
+        reinterpret_cast<char*>(&frame_count_) -
+        reinterpret_cast<char*>(&id_)) + sizeof(frame_count_));
+  }
+  _has_bits_.Clear();
+  _internal_metadata_.Clear();
+}
+
+bool Laser_parameter::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:Terminal.Laser_parameter)
+  for (;;) {
+    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
+    tag = p.first;
+    if (!p.second) goto handle_unusual;
+    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+      // required int64 id = 1;
+      case 1: {
+        if (static_cast< ::google::protobuf::uint8>(tag) ==
+            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
+          set_has_id();
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
+                 input, &id_)));
+        } else {
+          goto handle_unusual;
+        }
+        break;
+      }
+
+      // optional int64 frame_count = 2;
+      case 2: {
+        if (static_cast< ::google::protobuf::uint8>(tag) ==
+            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
+          set_has_frame_count();
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
+                 input, &frame_count_)));
+        } 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:Terminal.Laser_parameter)
+  return true;
+failure:
+  // @@protoc_insertion_point(parse_failure:Terminal.Laser_parameter)
+  return false;
+#undef DO_
+}
+
+void Laser_parameter::SerializeWithCachedSizes(
+    ::google::protobuf::io::CodedOutputStream* output) const {
+  // @@protoc_insertion_point(serialize_start:Terminal.Laser_parameter)
+  ::google::protobuf::uint32 cached_has_bits = 0;
+  (void) cached_has_bits;
+
+  cached_has_bits = _has_bits_[0];
+  // required int64 id = 1;
+  if (cached_has_bits & 0x00000001u) {
+    ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->id(), output);
+  }
+
+  // optional int64 frame_count = 2;
+  if (cached_has_bits & 0x00000002u) {
+    ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->frame_count(), output);
+  }
+
+  if (_internal_metadata_.have_unknown_fields()) {
+    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
+        _internal_metadata_.unknown_fields(), output);
+  }
+  // @@protoc_insertion_point(serialize_end:Terminal.Laser_parameter)
+}
+
+::google::protobuf::uint8* Laser_parameter::InternalSerializeWithCachedSizesToArray(
+    bool deterministic, ::google::protobuf::uint8* target) const {
+  (void)deterministic; // Unused
+  // @@protoc_insertion_point(serialize_to_array_start:Terminal.Laser_parameter)
+  ::google::protobuf::uint32 cached_has_bits = 0;
+  (void) cached_has_bits;
+
+  cached_has_bits = _has_bits_[0];
+  // required int64 id = 1;
+  if (cached_has_bits & 0x00000001u) {
+    target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->id(), target);
+  }
+
+  // optional int64 frame_count = 2;
+  if (cached_has_bits & 0x00000002u) {
+    target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->frame_count(), 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:Terminal.Laser_parameter)
+  return target;
+}
+
+size_t Laser_parameter::ByteSizeLong() const {
+// @@protoc_insertion_point(message_byte_size_start:Terminal.Laser_parameter)
+  size_t total_size = 0;
+
+  if (_internal_metadata_.have_unknown_fields()) {
+    total_size +=
+      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
+        _internal_metadata_.unknown_fields());
+  }
+  // required int64 id = 1;
+  if (has_id()) {
+    total_size += 1 +
+      ::google::protobuf::internal::WireFormatLite::Int64Size(
+        this->id());
+  }
+  // optional int64 frame_count = 2;
+  if (has_frame_count()) {
+    total_size += 1 +
+      ::google::protobuf::internal::WireFormatLite::Int64Size(
+        this->frame_count());
+  }
+
+  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 Laser_parameter::MergeFrom(const ::google::protobuf::Message& from) {
+// @@protoc_insertion_point(generalized_merge_from_start:Terminal.Laser_parameter)
+  GOOGLE_DCHECK_NE(&from, this);
+  const Laser_parameter* source =
+      ::google::protobuf::internal::DynamicCastToGenerated<const Laser_parameter>(
+          &from);
+  if (source == NULL) {
+  // @@protoc_insertion_point(generalized_merge_from_cast_fail:Terminal.Laser_parameter)
+    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
+  } else {
+  // @@protoc_insertion_point(generalized_merge_from_cast_success:Terminal.Laser_parameter)
+    MergeFrom(*source);
+  }
+}
+
+void Laser_parameter::MergeFrom(const Laser_parameter& from) {
+// @@protoc_insertion_point(class_specific_merge_from_start:Terminal.Laser_parameter)
+  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 & 3u) {
+    if (cached_has_bits & 0x00000001u) {
+      id_ = from.id_;
+    }
+    if (cached_has_bits & 0x00000002u) {
+      frame_count_ = from.frame_count_;
+    }
+    _has_bits_[0] |= cached_has_bits;
+  }
+}
+
+void Laser_parameter::CopyFrom(const ::google::protobuf::Message& from) {
+// @@protoc_insertion_point(generalized_copy_from_start:Terminal.Laser_parameter)
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+void Laser_parameter::CopyFrom(const Laser_parameter& from) {
+// @@protoc_insertion_point(class_specific_copy_from_start:Terminal.Laser_parameter)
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+bool Laser_parameter::IsInitialized() const {
+  if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
+  return true;
+}
+
+void Laser_parameter::Swap(Laser_parameter* other) {
+  if (other == this) return;
+  InternalSwap(other);
+}
+void Laser_parameter::InternalSwap(Laser_parameter* other) {
+  using std::swap;
+  swap(id_, other->id_);
+  swap(frame_count_, other->frame_count_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
+  _internal_metadata_.Swap(&other->_internal_metadata_);
+  swap(_cached_size_, other->_cached_size_);
+}
+
+::google::protobuf::Metadata Laser_parameter::GetMetadata() const {
+  protobuf_Terminor_5fparameter_2eproto::protobuf_AssignDescriptorsOnce();
+  return ::protobuf_Terminor_5fparameter_2eproto::file_level_metadata[kIndexInFileMessages];
+}
+
+
 // ===================================================================
 
 void Terminor_parameter::InitAsDefaultInstance() {
@@ -663,6 +1000,7 @@ void Terminor_parameter::InitAsDefaultInstance() {
 #if !defined(_MSC_VER) || _MSC_VER >= 1900
 const int Terminor_parameter::kArea3DFieldNumber;
 const int Terminor_parameter::kIdFieldNumber;
+const int Terminor_parameter::kLaserParameterFieldNumber;
 #endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
 
 Terminor_parameter::Terminor_parameter()
@@ -677,7 +1015,8 @@ Terminor_parameter::Terminor_parameter(const Terminor_parameter& from)
   : ::google::protobuf::Message(),
       _internal_metadata_(NULL),
       _has_bits_(from._has_bits_),
-      _cached_size_(0) {
+      _cached_size_(0),
+      laser_parameter_(from.laser_parameter_) {
   _internal_metadata_.MergeFrom(from._internal_metadata_);
   if (from.has_area_3d()) {
     area_3d_ = new ::Terminal::Area3d(*from.area_3d_);
@@ -733,6 +1072,7 @@ void Terminor_parameter::Clear() {
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
+  laser_parameter_.Clear();
   cached_has_bits = _has_bits_[0];
   if (cached_has_bits & 0x00000001u) {
     GOOGLE_DCHECK(area_3d_ != NULL);
@@ -779,6 +1119,17 @@ bool Terminor_parameter::MergePartialFromCodedStream(
         break;
       }
 
+      // repeated .Terminal.Laser_parameter laser_parameter = 3;
+      case 3: {
+        if (static_cast< ::google::protobuf::uint8>(tag) ==
+            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
+          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_laser_parameter()));
+        } else {
+          goto handle_unusual;
+        }
+        break;
+      }
+
       default: {
       handle_unusual:
         if (tag == 0) {
@@ -817,6 +1168,13 @@ void Terminor_parameter::SerializeWithCachedSizes(
     ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->id(), output);
   }
 
+  // repeated .Terminal.Laser_parameter laser_parameter = 3;
+  for (unsigned int i = 0,
+      n = static_cast<unsigned int>(this->laser_parameter_size()); i < n; i++) {
+    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
+      3, this->laser_parameter(static_cast<int>(i)), output);
+  }
+
   if (_internal_metadata_.have_unknown_fields()) {
     ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
         _internal_metadata_.unknown_fields(), output);
@@ -844,6 +1202,14 @@ void Terminor_parameter::SerializeWithCachedSizes(
     target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->id(), target);
   }
 
+  // repeated .Terminal.Laser_parameter laser_parameter = 3;
+  for (unsigned int i = 0,
+      n = static_cast<unsigned int>(this->laser_parameter_size()); i < n; i++) {
+    target = ::google::protobuf::internal::WireFormatLite::
+      InternalWriteMessageToArray(
+        3, this->laser_parameter(static_cast<int>(i)), deterministic, target);
+  }
+
   if (_internal_metadata_.have_unknown_fields()) {
     target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
         _internal_metadata_.unknown_fields(), target);
@@ -895,6 +1261,17 @@ size_t Terminor_parameter::ByteSizeLong() const {
   } else {
     total_size += RequiredFieldsByteSizeFallback();
   }
+  // repeated .Terminal.Laser_parameter laser_parameter = 3;
+  {
+    unsigned int count = static_cast<unsigned int>(this->laser_parameter_size());
+    total_size += 1UL * count;
+    for (unsigned int i = 0; i < count; i++) {
+      total_size +=
+        ::google::protobuf::internal::WireFormatLite::MessageSize(
+          this->laser_parameter(static_cast<int>(i)));
+    }
+  }
+
   int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
   GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
   _cached_size_ = cached_size;
@@ -924,6 +1301,7 @@ void Terminor_parameter::MergeFrom(const Terminor_parameter& from) {
   ::google::protobuf::uint32 cached_has_bits = 0;
   (void) cached_has_bits;
 
+  laser_parameter_.MergeFrom(from.laser_parameter_);
   cached_has_bits = from._has_bits_[0];
   if (cached_has_bits & 3u) {
     if (cached_has_bits & 0x00000001u) {
@@ -952,6 +1330,7 @@ void Terminor_parameter::CopyFrom(const Terminor_parameter& from) {
 
 bool Terminor_parameter::IsInitialized() const {
   if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;
+  if (!::google::protobuf::internal::AllAreInitialized(this->laser_parameter())) return false;
   if (has_area_3d()) {
     if (!this->area_3d_->IsInitialized()) return false;
   }
@@ -964,6 +1343,7 @@ void Terminor_parameter::Swap(Terminor_parameter* other) {
 }
 void Terminor_parameter::InternalSwap(Terminor_parameter* other) {
   using std::swap;
+  laser_parameter_.InternalSwap(&other->laser_parameter_);
   swap(area_3d_, other->area_3d_);
   swap(id_, other->id_);
   swap(_has_bits_[0], other->_has_bits_[0]);
@@ -983,6 +1363,7 @@ void Terminor_parameter_all::InitAsDefaultInstance() {
 }
 #if !defined(_MSC_VER) || _MSC_VER >= 1900
 const int Terminor_parameter_all::kTerminorParametersFieldNumber;
+const int Terminor_parameter_all::kSaveRootPathFieldNumber;
 #endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
 
 Terminor_parameter_all::Terminor_parameter_all()
@@ -1000,11 +1381,16 @@ Terminor_parameter_all::Terminor_parameter_all(const Terminor_parameter_all& fro
       _cached_size_(0),
       terminor_parameters_(from.terminor_parameters_) {
   _internal_metadata_.MergeFrom(from._internal_metadata_);
+  save_root_path_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (from.has_save_root_path()) {
+    save_root_path_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.save_root_path_);
+  }
   // @@protoc_insertion_point(copy_constructor:Terminal.Terminor_parameter_all)
 }
 
 void Terminor_parameter_all::SharedCtor() {
   _cached_size_ = 0;
+  save_root_path_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
 }
 
 Terminor_parameter_all::~Terminor_parameter_all() {
@@ -1013,6 +1399,7 @@ Terminor_parameter_all::~Terminor_parameter_all() {
 }
 
 void Terminor_parameter_all::SharedDtor() {
+  save_root_path_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
 }
 
 void Terminor_parameter_all::SetCachedSize(int size) const {
@@ -1045,6 +1432,11 @@ void Terminor_parameter_all::Clear() {
   (void) cached_has_bits;
 
   terminor_parameters_.Clear();
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x00000001u) {
+    GOOGLE_DCHECK(!save_root_path_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
+    (*save_root_path_.UnsafeRawStringPointer())->clear();
+  }
   _has_bits_.Clear();
   _internal_metadata_.Clear();
 }
@@ -1070,6 +1462,22 @@ bool Terminor_parameter_all::MergePartialFromCodedStream(
         break;
       }
 
+      // required string save_root_path = 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_save_root_path()));
+          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
+            this->save_root_path().data(), static_cast<int>(this->save_root_path().length()),
+            ::google::protobuf::internal::WireFormat::PARSE,
+            "Terminal.Terminor_parameter_all.save_root_path");
+        } else {
+          goto handle_unusual;
+        }
+        break;
+      }
+
       default: {
       handle_unusual:
         if (tag == 0) {
@@ -1103,6 +1511,17 @@ void Terminor_parameter_all::SerializeWithCachedSizes(
       1, this->terminor_parameters(static_cast<int>(i)), output);
   }
 
+  cached_has_bits = _has_bits_[0];
+  // required string save_root_path = 2;
+  if (cached_has_bits & 0x00000001u) {
+    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->save_root_path().data(), static_cast<int>(this->save_root_path().length()),
+      ::google::protobuf::internal::WireFormat::SERIALIZE,
+      "Terminal.Terminor_parameter_all.save_root_path");
+    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
+      2, this->save_root_path(), output);
+  }
+
   if (_internal_metadata_.have_unknown_fields()) {
     ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
         _internal_metadata_.unknown_fields(), output);
@@ -1125,6 +1544,18 @@ void Terminor_parameter_all::SerializeWithCachedSizes(
         1, this->terminor_parameters(static_cast<int>(i)), deterministic, target);
   }
 
+  cached_has_bits = _has_bits_[0];
+  // required string save_root_path = 2;
+  if (cached_has_bits & 0x00000001u) {
+    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->save_root_path().data(), static_cast<int>(this->save_root_path().length()),
+      ::google::protobuf::internal::WireFormat::SERIALIZE,
+      "Terminal.Terminor_parameter_all.save_root_path");
+    target =
+      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
+        2, this->save_root_path(), target);
+  }
+
   if (_internal_metadata_.have_unknown_fields()) {
     target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
         _internal_metadata_.unknown_fields(), target);
@@ -1142,6 +1573,12 @@ size_t Terminor_parameter_all::ByteSizeLong() const {
       ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
         _internal_metadata_.unknown_fields());
   }
+  // required string save_root_path = 2;
+  if (has_save_root_path()) {
+    total_size += 1 +
+      ::google::protobuf::internal::WireFormatLite::StringSize(
+        this->save_root_path());
+  }
   // repeated .Terminal.Terminor_parameter terminor_parameters = 1;
   {
     unsigned int count = static_cast<unsigned int>(this->terminor_parameters_size());
@@ -1183,6 +1620,10 @@ void Terminor_parameter_all::MergeFrom(const Terminor_parameter_all& from) {
   (void) cached_has_bits;
 
   terminor_parameters_.MergeFrom(from.terminor_parameters_);
+  if (from.has_save_root_path()) {
+    set_has_save_root_path();
+    save_root_path_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.save_root_path_);
+  }
 }
 
 void Terminor_parameter_all::CopyFrom(const ::google::protobuf::Message& from) {
@@ -1200,6 +1641,7 @@ void Terminor_parameter_all::CopyFrom(const Terminor_parameter_all& from) {
 }
 
 bool Terminor_parameter_all::IsInitialized() const {
+  if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
   if (!::google::protobuf::internal::AllAreInitialized(this->terminor_parameters())) return false;
   return true;
 }
@@ -1211,6 +1653,7 @@ void Terminor_parameter_all::Swap(Terminor_parameter_all* other) {
 void Terminor_parameter_all::InternalSwap(Terminor_parameter_all* other) {
   using std::swap;
   terminor_parameters_.InternalSwap(&other->terminor_parameters_);
+  save_root_path_.Swap(&other->save_root_path_);
   swap(_has_bits_[0], other->_has_bits_[0]);
   _internal_metadata_.Swap(&other->_internal_metadata_);
   swap(_cached_size_, other->_cached_size_);

+ 307 - 3
terminor/Terminor_parameter.pb.h

@@ -36,7 +36,7 @@ namespace protobuf_Terminor_5fparameter_2eproto {
 struct TableStruct {
   static const ::google::protobuf::internal::ParseTableField entries[];
   static const ::google::protobuf::internal::AuxillaryParseTableField aux[];
-  static const ::google::protobuf::internal::ParseTable schema[3];
+  static const ::google::protobuf::internal::ParseTable schema[4];
   static const ::google::protobuf::internal::FieldMetadata field_metadata[];
   static const ::google::protobuf::internal::SerializationTable serialization_table[];
   static const ::google::protobuf::uint32 offsets[];
@@ -44,12 +44,15 @@ struct TableStruct {
 void AddDescriptors();
 void InitDefaultsArea3dImpl();
 void InitDefaultsArea3d();
+void InitDefaultsLaser_parameterImpl();
+void InitDefaultsLaser_parameter();
 void InitDefaultsTerminor_parameterImpl();
 void InitDefaultsTerminor_parameter();
 void InitDefaultsTerminor_parameter_allImpl();
 void InitDefaultsTerminor_parameter_all();
 inline void InitDefaults() {
   InitDefaultsArea3d();
+  InitDefaultsLaser_parameter();
   InitDefaultsTerminor_parameter();
   InitDefaultsTerminor_parameter_all();
 }
@@ -58,6 +61,9 @@ namespace Terminal {
 class Area3d;
 class Area3dDefaultTypeInternal;
 extern Area3dDefaultTypeInternal _Area3d_default_instance_;
+class Laser_parameter;
+class Laser_parameterDefaultTypeInternal;
+extern Laser_parameterDefaultTypeInternal _Laser_parameter_default_instance_;
 class Terminor_parameter;
 class Terminor_parameterDefaultTypeInternal;
 extern Terminor_parameterDefaultTypeInternal _Terminor_parameter_default_instance_;
@@ -232,6 +238,126 @@ class Area3d : public ::google::protobuf::Message /* @@protoc_insertion_point(cl
 };
 // -------------------------------------------------------------------
 
+class Laser_parameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:Terminal.Laser_parameter) */ {
+ public:
+  Laser_parameter();
+  virtual ~Laser_parameter();
+
+  Laser_parameter(const Laser_parameter& from);
+
+  inline Laser_parameter& operator=(const Laser_parameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
+  #if LANG_CXX11
+  Laser_parameter(Laser_parameter&& from) noexcept
+    : Laser_parameter() {
+    *this = ::std::move(from);
+  }
+
+  inline Laser_parameter& operator=(Laser_parameter&& 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 Laser_parameter& default_instance();
+
+  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static inline const Laser_parameter* internal_default_instance() {
+    return reinterpret_cast<const Laser_parameter*>(
+               &_Laser_parameter_default_instance_);
+  }
+  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+    1;
+
+  void Swap(Laser_parameter* other);
+  friend void swap(Laser_parameter& a, Laser_parameter& b) {
+    a.Swap(&b);
+  }
+
+  // implements Message ----------------------------------------------
+
+  inline Laser_parameter* New() const PROTOBUF_FINAL { return New(NULL); }
+
+  Laser_parameter* 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 Laser_parameter& from);
+  void MergeFrom(const Laser_parameter& 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(Laser_parameter* 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 int64 id = 1;
+  bool has_id() const;
+  void clear_id();
+  static const int kIdFieldNumber = 1;
+  ::google::protobuf::int64 id() const;
+  void set_id(::google::protobuf::int64 value);
+
+  // optional int64 frame_count = 2;
+  bool has_frame_count() const;
+  void clear_frame_count();
+  static const int kFrameCountFieldNumber = 2;
+  ::google::protobuf::int64 frame_count() const;
+  void set_frame_count(::google::protobuf::int64 value);
+
+  // @@protoc_insertion_point(class_scope:Terminal.Laser_parameter)
+ private:
+  void set_has_id();
+  void clear_has_id();
+  void set_has_frame_count();
+  void clear_has_frame_count();
+
+  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
+  ::google::protobuf::internal::HasBits<1> _has_bits_;
+  mutable int _cached_size_;
+  ::google::protobuf::int64 id_;
+  ::google::protobuf::int64 frame_count_;
+  friend struct ::protobuf_Terminor_5fparameter_2eproto::TableStruct;
+  friend void ::protobuf_Terminor_5fparameter_2eproto::InitDefaultsLaser_parameterImpl();
+};
+// -------------------------------------------------------------------
+
 class Terminor_parameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:Terminal.Terminor_parameter) */ {
  public:
   Terminor_parameter();
@@ -274,7 +400,7 @@ class Terminor_parameter : public ::google::protobuf::Message /* @@protoc_insert
                &_Terminor_parameter_default_instance_);
   }
   static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
-    1;
+    2;
 
   void Swap(Terminor_parameter* other);
   friend void swap(Terminor_parameter& a, Terminor_parameter& b) {
@@ -321,6 +447,18 @@ class Terminor_parameter : public ::google::protobuf::Message /* @@protoc_insert
 
   // accessors -------------------------------------------------------
 
+  // repeated .Terminal.Laser_parameter laser_parameter = 3;
+  int laser_parameter_size() const;
+  void clear_laser_parameter();
+  static const int kLaserParameterFieldNumber = 3;
+  const ::Terminal::Laser_parameter& laser_parameter(int index) const;
+  ::Terminal::Laser_parameter* mutable_laser_parameter(int index);
+  ::Terminal::Laser_parameter* add_laser_parameter();
+  ::google::protobuf::RepeatedPtrField< ::Terminal::Laser_parameter >*
+      mutable_laser_parameter();
+  const ::google::protobuf::RepeatedPtrField< ::Terminal::Laser_parameter >&
+      laser_parameter() const;
+
   // required .Terminal.Area3d area_3d = 1;
   bool has_area_3d() const;
   void clear_area_3d();
@@ -350,6 +488,7 @@ class Terminor_parameter : public ::google::protobuf::Message /* @@protoc_insert
   ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
   ::google::protobuf::internal::HasBits<1> _has_bits_;
   mutable int _cached_size_;
+  ::google::protobuf::RepeatedPtrField< ::Terminal::Laser_parameter > laser_parameter_;
   ::Terminal::Area3d* area_3d_;
   ::google::protobuf::int64 id_;
   friend struct ::protobuf_Terminor_5fparameter_2eproto::TableStruct;
@@ -399,7 +538,7 @@ class Terminor_parameter_all : public ::google::protobuf::Message /* @@protoc_in
                &_Terminor_parameter_all_default_instance_);
   }
   static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
-    2;
+    3;
 
   void Swap(Terminor_parameter_all* other);
   friend void swap(Terminor_parameter_all& a, Terminor_parameter_all& b) {
@@ -458,13 +597,31 @@ class Terminor_parameter_all : public ::google::protobuf::Message /* @@protoc_in
   const ::google::protobuf::RepeatedPtrField< ::Terminal::Terminor_parameter >&
       terminor_parameters() const;
 
+  // required string save_root_path = 2;
+  bool has_save_root_path() const;
+  void clear_save_root_path();
+  static const int kSaveRootPathFieldNumber = 2;
+  const ::std::string& save_root_path() const;
+  void set_save_root_path(const ::std::string& value);
+  #if LANG_CXX11
+  void set_save_root_path(::std::string&& value);
+  #endif
+  void set_save_root_path(const char* value);
+  void set_save_root_path(const char* value, size_t size);
+  ::std::string* mutable_save_root_path();
+  ::std::string* release_save_root_path();
+  void set_allocated_save_root_path(::std::string* save_root_path);
+
   // @@protoc_insertion_point(class_scope:Terminal.Terminor_parameter_all)
  private:
+  void set_has_save_root_path();
+  void clear_has_save_root_path();
 
   ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
   ::google::protobuf::internal::HasBits<1> _has_bits_;
   mutable int _cached_size_;
   ::google::protobuf::RepeatedPtrField< ::Terminal::Terminor_parameter > terminor_parameters_;
+  ::google::protobuf::internal::ArenaStringPtr save_root_path_;
   friend struct ::protobuf_Terminor_5fparameter_2eproto::TableStruct;
   friend void ::protobuf_Terminor_5fparameter_2eproto::InitDefaultsTerminor_parameter_allImpl();
 };
@@ -625,6 +782,58 @@ inline void Area3d::set_max_z(float value) {
 
 // -------------------------------------------------------------------
 
+// Laser_parameter
+
+// required int64 id = 1;
+inline bool Laser_parameter::has_id() const {
+  return (_has_bits_[0] & 0x00000001u) != 0;
+}
+inline void Laser_parameter::set_has_id() {
+  _has_bits_[0] |= 0x00000001u;
+}
+inline void Laser_parameter::clear_has_id() {
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline void Laser_parameter::clear_id() {
+  id_ = GOOGLE_LONGLONG(0);
+  clear_has_id();
+}
+inline ::google::protobuf::int64 Laser_parameter::id() const {
+  // @@protoc_insertion_point(field_get:Terminal.Laser_parameter.id)
+  return id_;
+}
+inline void Laser_parameter::set_id(::google::protobuf::int64 value) {
+  set_has_id();
+  id_ = value;
+  // @@protoc_insertion_point(field_set:Terminal.Laser_parameter.id)
+}
+
+// optional int64 frame_count = 2;
+inline bool Laser_parameter::has_frame_count() const {
+  return (_has_bits_[0] & 0x00000002u) != 0;
+}
+inline void Laser_parameter::set_has_frame_count() {
+  _has_bits_[0] |= 0x00000002u;
+}
+inline void Laser_parameter::clear_has_frame_count() {
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline void Laser_parameter::clear_frame_count() {
+  frame_count_ = GOOGLE_LONGLONG(0);
+  clear_has_frame_count();
+}
+inline ::google::protobuf::int64 Laser_parameter::frame_count() const {
+  // @@protoc_insertion_point(field_get:Terminal.Laser_parameter.frame_count)
+  return frame_count_;
+}
+inline void Laser_parameter::set_frame_count(::google::protobuf::int64 value) {
+  set_has_frame_count();
+  frame_count_ = value;
+  // @@protoc_insertion_point(field_set:Terminal.Laser_parameter.frame_count)
+}
+
+// -------------------------------------------------------------------
+
 // Terminor_parameter
 
 // required .Terminal.Area3d area_3d = 1;
@@ -705,6 +914,36 @@ inline void Terminor_parameter::set_id(::google::protobuf::int64 value) {
   // @@protoc_insertion_point(field_set:Terminal.Terminor_parameter.id)
 }
 
+// repeated .Terminal.Laser_parameter laser_parameter = 3;
+inline int Terminor_parameter::laser_parameter_size() const {
+  return laser_parameter_.size();
+}
+inline void Terminor_parameter::clear_laser_parameter() {
+  laser_parameter_.Clear();
+}
+inline const ::Terminal::Laser_parameter& Terminor_parameter::laser_parameter(int index) const {
+  // @@protoc_insertion_point(field_get:Terminal.Terminor_parameter.laser_parameter)
+  return laser_parameter_.Get(index);
+}
+inline ::Terminal::Laser_parameter* Terminor_parameter::mutable_laser_parameter(int index) {
+  // @@protoc_insertion_point(field_mutable:Terminal.Terminor_parameter.laser_parameter)
+  return laser_parameter_.Mutable(index);
+}
+inline ::Terminal::Laser_parameter* Terminor_parameter::add_laser_parameter() {
+  // @@protoc_insertion_point(field_add:Terminal.Terminor_parameter.laser_parameter)
+  return laser_parameter_.Add();
+}
+inline ::google::protobuf::RepeatedPtrField< ::Terminal::Laser_parameter >*
+Terminor_parameter::mutable_laser_parameter() {
+  // @@protoc_insertion_point(field_mutable_list:Terminal.Terminor_parameter.laser_parameter)
+  return &laser_parameter_;
+}
+inline const ::google::protobuf::RepeatedPtrField< ::Terminal::Laser_parameter >&
+Terminor_parameter::laser_parameter() const {
+  // @@protoc_insertion_point(field_list:Terminal.Terminor_parameter.laser_parameter)
+  return laser_parameter_;
+}
+
 // -------------------------------------------------------------------
 
 // Terminor_parameter_all
@@ -739,6 +978,69 @@ Terminor_parameter_all::terminor_parameters() const {
   return terminor_parameters_;
 }
 
+// required string save_root_path = 2;
+inline bool Terminor_parameter_all::has_save_root_path() const {
+  return (_has_bits_[0] & 0x00000001u) != 0;
+}
+inline void Terminor_parameter_all::set_has_save_root_path() {
+  _has_bits_[0] |= 0x00000001u;
+}
+inline void Terminor_parameter_all::clear_has_save_root_path() {
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline void Terminor_parameter_all::clear_save_root_path() {
+  save_root_path_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  clear_has_save_root_path();
+}
+inline const ::std::string& Terminor_parameter_all::save_root_path() const {
+  // @@protoc_insertion_point(field_get:Terminal.Terminor_parameter_all.save_root_path)
+  return save_root_path_.GetNoArena();
+}
+inline void Terminor_parameter_all::set_save_root_path(const ::std::string& value) {
+  set_has_save_root_path();
+  save_root_path_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+  // @@protoc_insertion_point(field_set:Terminal.Terminor_parameter_all.save_root_path)
+}
+#if LANG_CXX11
+inline void Terminor_parameter_all::set_save_root_path(::std::string&& value) {
+  set_has_save_root_path();
+  save_root_path_.SetNoArena(
+    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
+  // @@protoc_insertion_point(field_set_rvalue:Terminal.Terminor_parameter_all.save_root_path)
+}
+#endif
+inline void Terminor_parameter_all::set_save_root_path(const char* value) {
+  GOOGLE_DCHECK(value != NULL);
+  set_has_save_root_path();
+  save_root_path_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
+  // @@protoc_insertion_point(field_set_char:Terminal.Terminor_parameter_all.save_root_path)
+}
+inline void Terminor_parameter_all::set_save_root_path(const char* value, size_t size) {
+  set_has_save_root_path();
+  save_root_path_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
+      ::std::string(reinterpret_cast<const char*>(value), size));
+  // @@protoc_insertion_point(field_set_pointer:Terminal.Terminor_parameter_all.save_root_path)
+}
+inline ::std::string* Terminor_parameter_all::mutable_save_root_path() {
+  set_has_save_root_path();
+  // @@protoc_insertion_point(field_mutable:Terminal.Terminor_parameter_all.save_root_path)
+  return save_root_path_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+}
+inline ::std::string* Terminor_parameter_all::release_save_root_path() {
+  // @@protoc_insertion_point(field_release:Terminal.Terminor_parameter_all.save_root_path)
+  clear_has_save_root_path();
+  return save_root_path_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+}
+inline void Terminor_parameter_all::set_allocated_save_root_path(::std::string* save_root_path) {
+  if (save_root_path != NULL) {
+    set_has_save_root_path();
+  } else {
+    clear_has_save_root_path();
+  }
+  save_root_path_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), save_root_path);
+  // @@protoc_insertion_point(field_set_allocated:Terminal.Terminor_parameter_all.save_root_path)
+}
+
 #ifdef __GNUC__
   #pragma GCC diagnostic pop
 #endif  // __GNUC__
@@ -746,6 +1048,8 @@ Terminor_parameter_all::terminor_parameters() const {
 
 // -------------------------------------------------------------------
 
+// -------------------------------------------------------------------
+
 
 // @@protoc_insertion_point(namespace_scope)
 

+ 8 - 0
terminor/Terminor_parameter.proto

@@ -10,13 +10,21 @@ message Area3d
     required float min_z=5;
     required float max_z=6;
 }
+
+message Laser_parameter
+{
+    required int64 id=1;
+    optional int64 frame_count=2;
+}
 message Terminor_parameter
 {
     required Area3d area_3d=1;
     required int64 id=2;
+    repeated Laser_parameter laser_parameter=3;
 }
 
 message Terminor_parameter_all
 {
     repeated Terminor_parameter terminor_parameters=1;
+    required string save_root_path=2;
 }

+ 25 - 6
terminor/terminal_command_executor.cpp

@@ -216,7 +216,8 @@ Error_manager Terminor_Command_Executor::post_measure_information()
     measure_information.width=m_measure_information.locate_width;
     measure_information.height=m_measure_information.locate_hight;
     measure_information.wheel_base=m_measure_information.locate_wheel_base;
-    measure_information.terminal_id=m_terminor_parameter.id();
+    //plc终端编号从1开始,因此,上传给plc的终端编号必须+1
+    measure_information.terminal_id=m_terminor_parameter.id()+1;
     measure_information.correctness=m_measure_information.locate_correct;
 
     plc_task->set_result(measure_information);
@@ -251,19 +252,37 @@ Error_manager Terminor_Command_Executor::post_measure_information()
     return code;
 }
 
+void Terminor_Command_Executor::set_save_root_path(std::string root)
+{
+    m_save_root_path=root;
+}
+
 Error_manager Terminor_Command_Executor::scanning_measuring()
 {
     //计时起点
     auto t_start_point=std::chrono::system_clock::now();
+
+    //准备目录
+    time_t tt;
+    time( &tt );
+    tt = tt + 8*3600;  // transform the time zone
+    tm* t= gmtime( &tt );
+    char path[255]={0};
+    sprintf(path,"%s/%4d/%02d/%02d",m_save_root_path.c_str(),
+            t->tm_year + 1900,
+            t->tm_mon + 1,
+            t->tm_mday);
+    PathCreator path_creator;
+    path_creator.CreateDatePath(path);
+    std::string project_path;
+    path_creator.GetCurPath(project_path);
+
     Error_manager code;
     //第一步,启动雷达扫描点云,切换当前状态为扫描中
     pcl::PointCloud<pcl::PointXYZ>::Ptr scan_cloud(new pcl::PointCloud<pcl::PointXYZ>);
     std::mutex cloud_lock;
     std::vector<Task_Base*> laser_task_vector;
-    PathCreator path_creator;
-    path_creator.CreateDatePath("/home/zx/data/scans");
-    std::string project_path;
-    path_creator.GetCurPath(project_path);
+
     for(int i=0;i<mp_laser_vector.size();++i)
     {
         Laser_task* laser_task=new Laser_task();
@@ -347,7 +366,7 @@ Error_manager Terminor_Command_Executor::scanning_measuring()
     passY.setFilterFieldName("z");
     passY.setFilterLimits(m_terminor_parameter.area_3d().min_z(),m_terminor_parameter.area_3d().max_z());
     passY.filter(*locate_cloud);
-    LOG(INFO)<<"筛选点云点数 :"<<locate_cloud->size();
+    LOG(INFO)<<"筛选点云点数 : "<<locate_cloud->size();
 
     //第三步,创建测量任务, 进入测量中
     Locate_task* locate_task=new Locate_task();

+ 8 - 0
terminor/terminal_command_executor.h

@@ -56,6 +56,11 @@ public:
      * 强制正在执行的中断指令
      */
     Error_manager force_stop_command();
+    /*
+     * 设置保存文件的root路径
+     * 执行指令时会在此路径下,生成日期文件夹,格式为:/root_path/year/month/day/YYYYMMDD-HHMMSS文件夹
+     */
+    void set_save_root_path(std::string root);
 protected:
 
     static void thread_command_working(Terminor_Command_Executor* terminor);
@@ -67,6 +72,7 @@ protected:
     Error_manager scanning_measuring();
     /*
      * 执行上传plc任务
+     * plc终端编号从1开始
      */
     Error_manager post_measure_information();
 protected:
@@ -89,6 +95,8 @@ protected:
     bool                        mb_force_quit;
     //保存当前指令测量结果
     Locate_information          m_measure_information;
+    //保存文件的root目录
+    std::string                 m_save_root_path;
 
 };