Browse Source

增加测量回退,分配回退手动取消任务,增加手动操作步骤不匹配提示

zx 4 years ago
parent
commit
04fc8757af

+ 21 - 13
message/manual_operation_message.pb.cc

@@ -102,18 +102,20 @@ void AddDescriptorsImpl() {
       "on_msg\022%\n\tbase_info\030\001 \002(\0132\022.message.Base"
       "_info\022\017\n\007license\030\002 \002(\t\022%\n\tstep_type\030\003 \002("
       "\0162\022.message.Step_type\022-\n\014operate_type\030\004 "
-      "\002(\0162\027.message.Operation_type*\376\001\n\tStep_ty"
+      "\002(\0162\027.message.Operation_type*\335\002\n\tStep_ty"
       "pe\022\017\n\013eAlloc_step\020\000\022\021\n\reMeasure_step\020\001\022\021"
       "\n\reCompare_step\020\002\022\022\n\016eDispatch_step\020\003\022\021\n"
-      "\reConfirm_step\020\004\022\r\n\teComplete\020\005\022\025\n\021eBack"
-      "Confirm_step\020\006\022\026\n\022eBackDispatch_step\020\007\022\026"
-      "\n\022eBack_compare_step\020\010\022\025\n\021eBackMeasure_s"
-      "tep\020\t\022\023\n\017eBackAlloc_step\020\n\022\021\n\reBackCompl"
-      "ete\020\013*$\n\016Operation_type\022\022\n\016eManual_cance"
-      "l\020\001"
+      "\reConfirm_step\020\004\022\020\n\014eSearch_step\020\005\022\016\n\neW"
+      "ait_step\020\006\022\021\n\reRelease_step\020\007\022\r\n\teComple"
+      "te\020\010\022\025\n\021eBackConfirm_step\020\t\022\026\n\022eBack_com"
+      "pare_step\020\n\022\025\n\021eBackMeasure_step\020\013\022\023\n\017eB"
+      "ackAlloc_step\020\014\022\022\n\016eBackWait_step\020\r\022\026\n\022e"
+      "BackDispatch_step\020\016\022\024\n\020eBackSearch_step\020"
+      "\017\022\021\n\reBackComplete\020\020*7\n\016Operation_type\022\022"
+      "\n\016eManual_cancel\020\000\022\021\n\reManual_retry\020\001"
   };
   ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
-      descriptor, 523);
+      descriptor, 637);
   ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
     "manual_operation_message.proto", &protobuf_RegisterTypes);
   ::protobuf_message_5fbase_2eproto::AddDescriptors();
@@ -149,6 +151,11 @@ bool Step_type_IsValid(int value) {
     case 9:
     case 10:
     case 11:
+    case 12:
+    case 13:
+    case 14:
+    case 15:
+    case 16:
       return true;
     default:
       return false;
@@ -161,6 +168,7 @@ const ::google::protobuf::EnumDescriptor* Operation_type_descriptor() {
 }
 bool Operation_type_IsValid(int value) {
   switch (value) {
+    case 0:
     case 1:
       return true;
     default:
@@ -219,9 +227,8 @@ void Manual_operation_msg::SharedCtor() {
   _cached_size_ = 0;
   license_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
   ::memset(&base_info_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&step_type_) -
-      reinterpret_cast<char*>(&base_info_)) + sizeof(step_type_));
-  operate_type_ = 1;
+      reinterpret_cast<char*>(&operate_type_) -
+      reinterpret_cast<char*>(&base_info_)) + sizeof(operate_type_));
 }
 
 Manual_operation_msg::~Manual_operation_msg() {
@@ -275,8 +282,9 @@ void Manual_operation_msg::Clear() {
     }
   }
   if (cached_has_bits & 12u) {
-    step_type_ = 0;
-    operate_type_ = 1;
+    ::memset(&step_type_, 0, static_cast<size_t>(
+        reinterpret_cast<char*>(&operate_type_) -
+        reinterpret_cast<char*>(&step_type_)) + sizeof(operate_type_));
   }
   _has_bits_.Clear();
   _internal_metadata_.Clear();

+ 16 - 10
message/manual_operation_message.pb.h

@@ -63,13 +63,18 @@ enum Step_type {
   eCompare_step = 2,
   eDispatch_step = 3,
   eConfirm_step = 4,
-  eComplete = 5,
-  eBackConfirm_step = 6,
-  eBackDispatch_step = 7,
-  eBack_compare_step = 8,
-  eBackMeasure_step = 9,
-  eBackAlloc_step = 10,
-  eBackComplete = 11
+  eSearch_step = 5,
+  eWait_step = 6,
+  eRelease_step = 7,
+  eComplete = 8,
+  eBackConfirm_step = 9,
+  eBack_compare_step = 10,
+  eBackMeasure_step = 11,
+  eBackAlloc_step = 12,
+  eBackWait_step = 13,
+  eBackDispatch_step = 14,
+  eBackSearch_step = 15,
+  eBackComplete = 16
 };
 bool Step_type_IsValid(int value);
 const Step_type Step_type_MIN = eAlloc_step;
@@ -87,11 +92,12 @@ inline bool Step_type_Parse(
     Step_type_descriptor(), name, value);
 }
 enum Operation_type {
-  eManual_cancel = 1
+  eManual_cancel = 0,
+  eManual_retry = 1
 };
 bool Operation_type_IsValid(int value);
 const Operation_type Operation_type_MIN = eManual_cancel;
-const Operation_type Operation_type_MAX = eManual_cancel;
+const Operation_type Operation_type_MAX = eManual_retry;
 const int Operation_type_ARRAYSIZE = Operation_type_MAX + 1;
 
 const ::google::protobuf::EnumDescriptor* Operation_type_descriptor();
@@ -417,7 +423,7 @@ inline void Manual_operation_msg::clear_has_operate_type() {
   _has_bits_[0] &= ~0x00000008u;
 }
 inline void Manual_operation_msg::clear_operate_type() {
-  operate_type_ = 1;
+  operate_type_ = 0;
   clear_has_operate_type();
 }
 inline ::message::Operation_type Manual_operation_msg::operate_type() const {

+ 19 - 9
message/manual_operation_message.proto

@@ -10,20 +10,30 @@ enum Step_type
     eCompare_step=2;
     eDispatch_step=3;
     eConfirm_step=4;
-    eComplete=5;
-
-    eBackConfirm_step=6;
-    eBackDispatch_step=7;
-    eBack_compare_step=8;
-    eBackMeasure_step=9;
-    eBackAlloc_step=10;
-    eBackComplete=11;
+
+    eSearch_step=5;        //查询数据库
+    eWait_step=6;             //等待车辆离开
+    eRelease_step=7;          //释放车位
+
+    eComplete=8;              //完成
+
+    eBackConfirm_step=9;
+    eBack_compare_step=10;
+    eBackMeasure_step=11;
+    eBackAlloc_step=12;
+
+    eBackWait_step=13;
+    eBackDispatch_step=14;
+    eBackSearch_step=15;
+
+    eBackComplete=16;
 }
 
 //手动操作类型
 enum Operation_type
 {
-    eManual_cancel=1;
+    eManual_cancel=0;                   //取消流程
+    eManual_retry=1;                    //重试
 }
 
 //中控手动操作消息

+ 9 - 2
solve_exception/exception_solver.cpp

@@ -109,8 +109,14 @@ Error_manager Exception_solver::waitfor_manual_operate_msg(Process_task* task,me
         {
             if(msg.has_base_info() && msg.has_license() && msg.has_operate_type() && msg.has_step_type())
             {
-                LOG(INFO)<<"查询到手动消息|||||||||||||||  : "<<msg.license();
-                return SUCCESS;
+                if(msg.license()==task->license()&&msg.step_type()==task->step_type()) {
+                    LOG(INFO) << "查询到手动消息|||||||||||||||  : " << msg.license();
+                    return SUCCESS;
+                }
+                else
+                {
+                    LOG(WARNING)<<"xxxx .. ..  非当前步骤的手动操作 车牌: "<<msg.license()<<", 操作步骤:"<<Step_type_Name(msg.step_type());
+                }
             }
         }
     }
@@ -139,6 +145,7 @@ Error_manager Exception_solver::solve_exception(Error_manager code,Process_task*
                 //取消任务
                 case message::eManual_cancel: {
                     task->Cancel();
+                    Command_manager::get_instance_pointer()->enable_entrance(task->terminal_id(),Command_manager::Entrance_statu::Enable);
                     return SUCCESS;
                 }
             }

+ 28 - 28
system/PickupProcessTask.cpp

@@ -38,7 +38,7 @@ Error_manager PickupProcessTask::init_task()
     m_process_msg.set_terminal_id(m_terminor_id);
     m_process_msg.set_license(m_car_info.license());
 
-    m_step_statu=eSearch_step;
+    m_step_type=eSearch_step;
     ///创建状态发布线程
     if(m_publish_statu_thread== nullptr)
     {
@@ -94,7 +94,7 @@ Error_manager PickupProcessTask::search_space()
 
     code = Parkspace_communicator::get_instance_pointer()->search_request(request,
             m_search_response_msg,m_cancel_condition);
-    m_step_statu=eDispatch_step;
+    m_step_type=eDispatch_step;
     return code;
 }
 
@@ -113,7 +113,7 @@ void PickupProcessTask::Main()
 
     while(1)
     {
-        if(m_step_statu== eDispatch_step)
+        if(m_step_type== eDispatch_step)
         {
             code=dispatch_step();
             usleep(1000*1000*(rand()%3));
@@ -123,16 +123,16 @@ void PickupProcessTask::Main()
                                            <<", 车位序号:"<<m_search_response_msg.car_position().index()
                                            <<", 车牌号:"<<m_car_info.license()
                                            <<", 库内车牌号:"<<m_search_response_msg.car_position().car_info().license();
-            m_step_statu = (code != SUCCESS) ?  eBackDispatch_step :  eWait_step;
+            m_step_type = (code != SUCCESS) ?  eBackDispatch_step :  eWait_step;
         }
-        if(m_step_statu== eWait_step)
+        if(m_step_type== eWait_step)
         {
             code=wait_for_leave_step();
             LOG_IF(ERROR, code != SUCCESS) << "等待车辆离开失败,取车终端:"<<m_terminor_id
                                            <<", 车牌号:"<<m_car_info.license();
-            m_step_statu = (code != SUCCESS) ?  eBackWait_step :  eRelease_step;
+            m_step_type = (code != SUCCESS) ?  eBackWait_step :  eRelease_step;
         }
-        if(m_step_statu== eRelease_step)
+        if(m_step_type== eRelease_step)
         {
             code=release_space_step();
             LOG_IF(ERROR, code != SUCCESS) << "取车释放车位失败,取车终端:"<<m_terminor_id
@@ -144,16 +144,16 @@ void PickupProcessTask::Main()
             }
             else
             {
-                m_step_statu= eComplete;
+                m_step_type= eComplete;
             }
         }
-        if(m_step_statu==eComplete) {
+        if(m_step_type==eComplete) {
             //至少发送一次流程完成状态
             updata_step_statu_msg();
             System_communicator::get_instance_pointer()->post_process_statu(m_process_msg);
             break;
         }
-        if(m_step_statu== eBackWait_step)
+        if(m_step_type== eBackWait_step)
         {
             code=back_wait_for_leave_step();
             if(code!=SUCCESS)
@@ -163,10 +163,10 @@ void PickupProcessTask::Main()
             }
             else
             {
-                m_step_statu= eBackDispatch_step;
+                m_step_type= eBackDispatch_step;
             }
         }
-        if(m_step_statu== eBackDispatch_step)
+        if(m_step_type== eBackDispatch_step)
         {
             code=back_dispatch_step();
             if(code!=SUCCESS)
@@ -176,10 +176,10 @@ void PickupProcessTask::Main()
             }
             else
             {
-                m_step_statu= eBackSearch_step;
+                m_step_type= eBackSearch_step;
             }
         }
-        if(m_step_statu== eBackSearch_step)
+        if(m_step_type== eBackSearch_step)
         {
             code=back_search_space_step();
             if(code!=SUCCESS)
@@ -189,10 +189,10 @@ void PickupProcessTask::Main()
             }
             else
             {
-                m_step_statu= eBackComplete;
+                m_step_type= eBackComplete;
             }
         }
-        if(m_step_statu== eBackComplete)
+        if(m_step_type== eBackComplete)
             break;
 
     }
@@ -200,14 +200,14 @@ void PickupProcessTask::Main()
     /*
       * 跳出循环后,判断状态,是否正常结束, 循环跳出状态只有可能是 eBackComplete(异常结束),eComplete(正常结束)
       */
-    if(m_step_statu== eBackComplete)
+    if(m_step_type== eBackComplete)
     {
         //异常结束
         usleep(1000*5000);
         LOG(ERROR)<<"异常停车,回退结束"<<"车牌号:"<<m_car_info.license()
                   <<",xxxxxxxxxxxxxx  终端:"<<m_terminor_id<<"  xxxxxxxxxxxxxx";
     }
-    if(m_step_statu== eComplete)
+    if(m_step_type== eComplete)
     {
         //正常结束
         usleep(1000*1000);
@@ -359,24 +359,24 @@ void PickupProcessTask::updata_step_statu_msg()
     wait_step_statu.set_step_statu(message::eWaiting);
     release_step_statu.set_step_statu(message::eWaiting);
 
-    switch (m_step_statu) {
+    switch (m_step_type) {
         case  eSearch_step: {
             search_step_statu.set_step_statu(message::eWorking);
-            if(m_step_statu==eSearch_step)
+            if(m_step_type==eSearch_step)
                 break;
         }
         case  eDispatch_step: {
             search_step_statu.set_step_statu(message::eFinished);
             dispatch_step_statu.set_step_statu(message::eWorking);
             dispatch_step_statu.mutable_space_info()->CopyFrom(m_search_response_msg.car_position());
-            if(m_step_statu==eDispatch_step)
+            if(m_step_type==eDispatch_step)
                 break;
         }
         case  eWait_step: {
             dispatch_step_statu.set_step_statu(message::eFinished);
             wait_step_statu.set_step_statu(message::eWorking);
             wait_step_statu.mutable_car_info()->CopyFrom(m_car_info);
-            if(m_step_statu== eWait_step)
+            if(m_step_type== eWait_step)
                 break;
         }
         case  eRelease_step:
@@ -384,32 +384,32 @@ void PickupProcessTask::updata_step_statu_msg()
             wait_step_statu.set_step_statu(message::eFinished);
             release_step_statu.set_step_statu(message::eWorking);
             release_step_statu.mutable_space_info()->CopyFrom(m_search_response_msg.car_position());
-            if(m_step_statu== eRelease_step)
+            if(m_step_type== eRelease_step)
                 break;
         }
         case  eComplete: {
             release_step_statu.set_step_statu(message::eFinished);
-            if(m_step_statu==eComplete)
+            if(m_step_type==eComplete)
                 break;
         }
         case  eBackWait_step :{
             wait_step_statu.set_step_statu(message::eError);
-            if(m_step_statu== eBackWait_step)
+            if(m_step_type== eBackWait_step)
                 break;
         }
         case eBackDispatch_step: {
             dispatch_step_statu.set_step_statu(message::eError);
-            if(m_step_statu==eBackDispatch_step)
+            if(m_step_type==eBackDispatch_step)
                 break;
         }
         case eBackSearch_step: {
             search_step_statu.set_step_statu(message::eError);
-            if(m_step_statu==eBackSearch_step)
+            if(m_step_type==eBackSearch_step)
                 break;
         }
         case eBackComplete: {
             release_step_statu.set_step_statu(message::eFinished);
-            if(m_step_statu==eBackComplete)
+            if(m_step_type==eBackComplete)
                 break;
         }
         default:

+ 42 - 39
system/StoreProcessTask.cpp

@@ -44,7 +44,7 @@ Error_manager StoreProcessTask::init_task(message::Locate_information locate_inf
     m_process_msg.set_terminal_id(m_terminor_id);
     m_process_msg.set_license(m_car_info.license());
 
-    m_step_statu=eAlloc_step;
+    m_step_type=eAlloc_step;
     ///创建状态发布线程
     if(m_publish_statu_thread== nullptr)
     {
@@ -112,7 +112,7 @@ Error_manager StoreProcessTask::compare_step()
  */
 Error_manager StoreProcessTask::back_compare_step()
 {
-    int k=rand()%2;
+    int k=rand()%10;
     if(k==0)
         return Error_manager(ERROR,CRITICAL_ERROR,"回退检验对比失败");
     return SUCCESS;
@@ -192,7 +192,7 @@ Error_manager StoreProcessTask::alloc_space()
     /*
      * 检查是否有测量数据
      */
-    m_step_statu=eAlloc_step;
+    m_step_type=eAlloc_step;
     updata_step_statu_msg(message::eWorking);
     if(m_locate_info.has_locate_height()==false||m_locate_info.has_locate_width()==false)
     {
@@ -240,7 +240,7 @@ Error_manager StoreProcessTask::alloc_space()
         }
         updata_step_statu_msg(message::eFinished);
         //置步骤状态为测量状态.
-        m_step_statu=eMeasure_step;
+        m_step_type=eMeasure_step;
         return SUCCESS;
     }
     else
@@ -371,7 +371,7 @@ void StoreProcessTask::Main()
     while(m_cancel_condition.wait_for_millisecond(1)==false)
     {
         //第一步,测量
-        if (m_step_statu ==  eMeasure_step)
+        if (m_step_type ==  eMeasure_step)
         {
             //开始定位
             updata_step_statu_msg(message::eWorking);
@@ -379,32 +379,32 @@ void StoreProcessTask::Main()
             usleep(1000 * 1000 * (rand() % 5 + 1));
             code!=SUCCESS?updata_step_statu_msg(message::eError):updata_step_statu_msg(message::eFinished);
 
-            LOG_IF(ERROR, code != SUCCESS) << "测量失败:" << code.get_error_description();
-            m_step_statu = (code != SUCCESS) ?  eBackAlloc_step :  eCompare_step;
+            LOG_IF(ERROR, code != SUCCESS) << "测量失败:" <<m_car_info.license()<< code.get_error_description();
+            m_step_type = (code != SUCCESS) ?  eBackAlloc_step :  eCompare_step;
         }
-        if(m_step_statu== eCompare_step)
+        if(m_step_type== eCompare_step)
         {
             updata_step_statu_msg(message::eWorking);
             code=compare_step();
             usleep(500*1000);
             code!=SUCCESS?updata_step_statu_msg(message::eError):updata_step_statu_msg(message::eFinished);
-            LOG_IF(ERROR, code != SUCCESS) << "检验失败:" << code.get_error_description();
-            m_step_statu = (code != SUCCESS) ?  eBackMeasure_step :  eDispatch_step;
+            LOG_IF(ERROR, code != SUCCESS) << "检验失败:"<<m_car_info.license() << code.get_error_description();
+            m_step_type = (code != SUCCESS) ?  eBackMeasure_step :  eDispatch_step;
 
         }
         //第二步,调度
-        if (m_step_statu ==  eDispatch_step)
+        if (m_step_type ==  eDispatch_step)
         {
             //开始调度
             updata_step_statu_msg(message::eWorking);
             code = dispatch_step();
             usleep(1000 * 1000 * (rand() % 5));
             code!=SUCCESS?updata_step_statu_msg(message::eError):updata_step_statu_msg(message::eFinished);
-            LOG_IF(ERROR, code != SUCCESS) << "调度失败:" << code.get_error_description();
-            m_step_statu = (code != SUCCESS) ?  eBack_compare_step :  eConfirm_step;
+            LOG_IF(ERROR, code != SUCCESS) << "调度失败:"<<m_car_info.license() << code.get_error_description();
+            m_step_type = (code != SUCCESS) ?  eBack_compare_step :  eConfirm_step;
         }
         //第三步,占据车位
-        if (m_step_statu ==  eConfirm_step)
+        if (m_step_type ==  eConfirm_step)
         {
             updata_step_statu_msg(message::eWorking);
             code = confirm_space_step();
@@ -414,10 +414,10 @@ void StoreProcessTask::Main()
                                            " 车位id :"
                                            << m_parcspace_alloc_response_msg.allocated_space_info().parkspace_id()
                                            << ",车牌:" << m_car_info.license()<<code.to_string();
-            m_step_statu = (code != SUCCESS) ?  eBackDispatch_step :  eComplete;
+            m_step_type = (code != SUCCESS) ?  eBackDispatch_step :  eComplete;
         }
         //第四步,完成,退出循环
-        if (m_step_statu ==  eComplete)
+        if (m_step_type ==  eComplete)
         {
             //流程结束前,保证至少发送一次流程完成状态
             updata_step_statu_msg(message::eFinished);
@@ -426,14 +426,14 @@ void StoreProcessTask::Main()
 
         //回退confirm  ------------------------------------华丽的分割线------------------------------------------
 
-        if (m_step_statu ==  eBackConfirm_step)
+        if (m_step_type ==  eBackConfirm_step)
         {
             updata_step_statu_msg(message::eWorking);
             usleep(1000*1000);
             updata_step_statu_msg(message::eFinished);
-            m_step_statu= eBackDispatch_step;
+            m_step_type= eBackDispatch_step;
         }
-        if(m_step_statu== eBackDispatch_step)
+        if(m_step_type== eBackDispatch_step)
         {
             updata_step_statu_msg(message::eWorking);
             code=back_dispatch_step();
@@ -442,16 +442,17 @@ void StoreProcessTask::Main()
             if(code.get_error_level()>=MAJOR_ERROR)
             {
                 //提升错误等级为四级
+                LOG(ERROR)<<" 回退调度失败 ------进入异常处理,  车牌号:"<<m_car_info.license();
                 Exception_solver::get_instance_pointer()->solve_exception(code,this);
             }
             else
             {
-                m_step_statu= eBack_compare_step;
+                m_step_type= eBack_compare_step;
             }
 
         }
 
-        if(m_step_statu== eBack_compare_step)
+        if(m_step_type== eBack_compare_step)
         {
             updata_step_statu_msg(message::eWorking);
             code=back_compare_step();
@@ -459,16 +460,17 @@ void StoreProcessTask::Main()
             code!=SUCCESS?updata_step_statu_msg(message::eError):updata_step_statu_msg(message::eFinished);
             if(code.get_error_level()>=MAJOR_ERROR)
             {
+                LOG(ERROR)<<" 回退对比失败 ------进入异常处理,  车牌号:"<<m_car_info.license();
                 Exception_solver::get_instance_pointer()->solve_exception(code,this);
-                LOG(WARNING)<<" 手动处理完成,  继续 ..............................";
+                LOG(WARNING)<<" 手动处理 结果对比,  继续 ..........车牌:"<<m_car_info.license();
             }
             else
             {
-                m_step_statu= eBackMeasure_step;
+                m_step_type= eBackMeasure_step;
             }
         }
 
-        if(m_step_statu== eBackMeasure_step)
+        if(m_step_type== eBackMeasure_step)
         {
             updata_step_statu_msg(message::eWorking);
             code=back_locate_step();
@@ -477,14 +479,15 @@ void StoreProcessTask::Main()
             if(code.get_error_level()>=MAJOR_ERROR)
             {
                 //提升错误等级为四级
+                LOG(ERROR)<<" 回退测量失败 ------进入异常处理,  车牌号:"<<m_car_info.license();
                 Exception_solver::get_instance_pointer()->solve_exception(code,this);
             }
             else
             {
-                m_step_statu= eBackAlloc_step;
+                m_step_type= eBackAlloc_step;
             }
         }
-        if(m_step_statu== eBackAlloc_step)
+        if(m_step_type== eBackAlloc_step)
         {
             updata_step_statu_msg(message::eWorking);
             code=back_alloc_space_step();
@@ -493,14 +496,15 @@ void StoreProcessTask::Main()
             if(code.get_error_level()>=MAJOR_ERROR)
             {
                 //提升错误等级为四级
+                LOG(ERROR)<<" 回退分配车位失败 ------进入异常处理,  车牌号:"<<m_car_info.license();
                 Exception_solver::get_instance_pointer()->solve_exception(code,this);
             }
             else
             {
-                m_step_statu= eBackComplete;
+                m_step_type= eBackComplete;
             }
         }
-        if(m_step_statu== eBackComplete)
+        if(m_step_type== eBackComplete)
         {
             break;
         }
@@ -519,14 +523,14 @@ void StoreProcessTask::Main()
         return ;
     }
 
-    if(m_step_statu== eBackComplete)
+    if(m_step_type== eBackComplete)
     {
         //异常结束
         usleep(1000*1000);
         LOG(ERROR)<<"异常停车,回退结束"<<"车牌号:"<<m_car_info.license()
             <<",xxxxxxxxxxxxxx  终端:"<<m_terminor_id<<"  xxxxxxxxxxxxxx";
     }
-    if(m_step_statu== eComplete)
+    if(m_step_type== eComplete)
     {
         //正常结束
         usleep(1000*500);
@@ -552,7 +556,7 @@ void StoreProcessTask::publish_step_status() {
 void StoreProcessTask::updata_step_statu_msg(message::Step_statu statu)
 {
     std::lock_guard<std::mutex>         lock(m_process_msg_lock);
-    switch (m_step_statu) {
+    switch (m_step_type) {
         case  eAlloc_step: {
                 message::Alloc_space_step_statu alloc_step_statu;
                 alloc_step_statu.set_step_statu(statu);
@@ -560,7 +564,6 @@ void StoreProcessTask::updata_step_statu_msg(message::Step_statu statu)
             break;
         }
         case  eMeasure_step: {
-
                 message::Measure_step_statu measure_step_statu;
                 measure_step_statu.set_step_statu(statu);
                 measure_step_statu.mutable_locate_info()->CopyFrom(m_locate_info);
@@ -585,10 +588,10 @@ void StoreProcessTask::updata_step_statu_msg(message::Step_statu statu)
             break;
         }
         case  eConfirm_step: {
-            message::Confirm_space_step_statu           confirm_step_statu;
-            confirm_step_statu.set_step_statu(statu);
-            confirm_step_statu.mutable_space_info()->CopyFrom(m_parcspace_alloc_response_msg.allocated_space_info());
-            m_process_msg.mutable_confirm_space_step()->CopyFrom(confirm_step_statu);
+            message::Confirm_space_step_statu           confirm_step_type;
+            confirm_step_type.set_step_statu(statu);
+            confirm_step_type.mutable_space_info()->CopyFrom(m_parcspace_alloc_response_msg.allocated_space_info());
+            m_process_msg.mutable_confirm_space_step()->CopyFrom(confirm_step_type);
             break;
         }
         case  eComplete: {
@@ -596,9 +599,9 @@ void StoreProcessTask::updata_step_statu_msg(message::Step_statu statu)
             break;
         }
         case  eBackConfirm_step: {
-                message::Back_confirm_space_step_statu back_confirm_step_statu;
-                back_confirm_step_statu.set_step_statu(statu);
-                m_process_msg.mutable_back_confirm_step()->CopyFrom(back_confirm_step_statu);
+                message::Back_confirm_space_step_statu back_confirm_step_type;
+                back_confirm_step_type.set_step_statu(statu);
+                m_process_msg.mutable_back_confirm_step()->CopyFrom(back_confirm_step_type);
             break;
         }
         case  eBackDispatch_step: {

+ 2 - 2
system/process_task.cpp

@@ -30,7 +30,7 @@ Process_task::~Process_task()
  */
 void Process_task::Cancel()
 {
-    m_step_statu= eBackComplete;
+    m_step_type= eBackComplete;
     m_cancel_condition.set_pass_ever(true);
     tq::BaseTask::Cancel();
 }
@@ -43,7 +43,7 @@ void Process_task::publish_thread_func(Process_task* ptask)
     if(ptask)
     {
         //未收到退出信号
-        while(false==ptask->m_publish_exit_condition.wait_for_ex(std::chrono::milliseconds(50))) {
+        while(false==ptask->m_publish_exit_condition.wait_for_ex(std::chrono::milliseconds(100))) {
             ptask->publish_step_status();
         }
     }

+ 2 - 1
system/process_task.h

@@ -47,6 +47,7 @@ public:
     virtual ~Process_task();
     unsigned int terminal_id(){return m_terminor_id;}
     std::string license(){ return m_car_info.license();}
+    EStep_type step_type(){return m_step_type;}
     /*
      * 取消任务
      */
@@ -68,7 +69,7 @@ protected:
 protected:
     unsigned int                            m_terminor_id;
     message::Car_info                       m_car_info;                         //当前流程的车辆信息
-    EStep_type                              m_step_statu;
+    EStep_type                              m_step_type;
 
     std::thread*                            m_publish_statu_thread;             //广播状态线程
     Thread_condition				        m_publish_exit_condition;			//发送的条件变量

+ 11 - 11
system/system_setting.pb.cc

@@ -103,16 +103,16 @@ void protobuf_RegisterTypes(const ::std::string&) {
 void AddDescriptorsImpl() {
   InitDefaults();
   static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
-      "\n\024system_setting.proto\022\007setting\"\354\001\n\016Syst"
+      "\n\024system_setting.proto\022\007setting\"\355\001\n\016Syst"
       "em_setting\022\017\n\007bind_ip\030\001 \002(\t\022\034\n\rterminor_"
       "port\030\002 \001(\005:\00530000\022\036\n\017park_space_port\030\003 \001"
       "(\005:\00530001\022\034\n\rmeasurer_port\030\004 \001(\005:\00530002\022"
-      "\036\n\017dispatcher_port\030\005 \001(\005:\00530003\022#\n\025excep"
-      "tion_handle_port\030\006 \001(\005:\0043004\022\024\n\014entrance"
-      "_num\030\007 \002(\005\022\022\n\nexport_num\030\010 \002(\005"
+      "\036\n\017dispatcher_port\030\005 \001(\005:\00530003\022$\n\025excep"
+      "tion_handle_port\030\006 \001(\005:\00530004\022\024\n\014entranc"
+      "e_num\030\007 \002(\005\022\022\n\nexport_num\030\010 \002(\005"
   };
   ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
-      descriptor, 270);
+      descriptor, 271);
   ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
     "system_setting.proto", &protobuf_RegisterTypes);
 }
@@ -175,7 +175,7 @@ void System_setting::SharedCtor() {
   ::memset(&entrance_num_, 0, static_cast<size_t>(
       reinterpret_cast<char*>(&export_num_) -
       reinterpret_cast<char*>(&entrance_num_)) + sizeof(export_num_));
-  exception_handle_port_ = 3004;
+  exception_handle_port_ = 30004;
   terminor_port_ = 30000;
   park_space_port_ = 30001;
   measurer_port_ = 30002;
@@ -229,7 +229,7 @@ void System_setting::Clear() {
     ::memset(&entrance_num_, 0, static_cast<size_t>(
         reinterpret_cast<char*>(&export_num_) -
         reinterpret_cast<char*>(&entrance_num_)) + sizeof(export_num_));
-    exception_handle_port_ = 3004;
+    exception_handle_port_ = 30004;
     terminor_port_ = 30000;
     park_space_port_ = 30001;
     measurer_port_ = 30002;
@@ -321,7 +321,7 @@ bool System_setting::MergePartialFromCodedStream(
         break;
       }
 
-      // optional int32 exception_handle_port = 6 [default = 3004];
+      // optional int32 exception_handle_port = 6 [default = 30004];
       case 6: {
         if (static_cast< ::google::protobuf::uint8>(tag) ==
             static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) {
@@ -420,7 +420,7 @@ void System_setting::SerializeWithCachedSizes(
     ::google::protobuf::internal::WireFormatLite::WriteInt32(5, this->dispatcher_port(), output);
   }
 
-  // optional int32 exception_handle_port = 6 [default = 3004];
+  // optional int32 exception_handle_port = 6 [default = 30004];
   if (cached_has_bits & 0x00000008u) {
     ::google::protobuf::internal::WireFormatLite::WriteInt32(6, this->exception_handle_port(), output);
   }
@@ -481,7 +481,7 @@ void System_setting::SerializeWithCachedSizes(
     target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(5, this->dispatcher_port(), target);
   }
 
-  // optional int32 exception_handle_port = 6 [default = 3004];
+  // optional int32 exception_handle_port = 6 [default = 30004];
   if (cached_has_bits & 0x00000008u) {
     target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(6, this->exception_handle_port(), target);
   }
@@ -560,7 +560,7 @@ size_t System_setting::ByteSizeLong() const {
     total_size += RequiredFieldsByteSizeFallback();
   }
   if (_has_bits_[0 / 32] & 248u) {
-    // optional int32 exception_handle_port = 6 [default = 3004];
+    // optional int32 exception_handle_port = 6 [default = 30004];
     if (has_exception_handle_port()) {
       total_size += 1 +
         ::google::protobuf::internal::WireFormatLite::Int32Size(

+ 3 - 3
system/system_setting.pb.h

@@ -175,7 +175,7 @@ class System_setting : public ::google::protobuf::Message /* @@protoc_insertion_
   ::google::protobuf::int32 export_num() const;
   void set_export_num(::google::protobuf::int32 value);
 
-  // optional int32 exception_handle_port = 6 [default = 3004];
+  // optional int32 exception_handle_port = 6 [default = 30004];
   bool has_exception_handle_port() const;
   void clear_exception_handle_port();
   static const int kExceptionHandlePortFieldNumber = 6;
@@ -416,7 +416,7 @@ inline void System_setting::set_dispatcher_port(::google::protobuf::int32 value)
   // @@protoc_insertion_point(field_set:setting.System_setting.dispatcher_port)
 }
 
-// optional int32 exception_handle_port = 6 [default = 3004];
+// optional int32 exception_handle_port = 6 [default = 30004];
 inline bool System_setting::has_exception_handle_port() const {
   return (_has_bits_[0] & 0x00000008u) != 0;
 }
@@ -427,7 +427,7 @@ inline void System_setting::clear_has_exception_handle_port() {
   _has_bits_[0] &= ~0x00000008u;
 }
 inline void System_setting::clear_exception_handle_port() {
-  exception_handle_port_ = 3004;
+  exception_handle_port_ = 30004;
   clear_has_exception_handle_port();
 }
 inline ::google::protobuf::int32 System_setting::exception_handle_port() const {

+ 1 - 1
test/store_terminal.cpp

@@ -99,7 +99,7 @@ Error_manager store_terminal::storing(message::Car_info& car_info)
 
 void store_terminal::storing_thread(store_terminal* pStore)
 {
-    while(pStore->m_exit_cond.wait_for_millisecond(200)==false)
+    while(pStore->m_exit_cond.wait_for_millisecond(1)==false)
     {
         message::Car_info car_info;
         if(pStore->m_thread_safe_queue== nullptr)