|
@@ -83,19 +83,22 @@ Error_manager Terminor_Command_Executor::execute_command(std::vector<Laser_base*
|
|
|
{
|
|
|
if(lasers[i]==0)
|
|
|
{
|
|
|
- LOG(ERROR)<<"terminor input laser* is null index:"<<i<<" terminor id:"<<m_terminor_parameter.id();
|
|
|
- return TERMINOR_INPUT_LASER_NULL;
|
|
|
+ char description[255]={0};
|
|
|
+ sprintf(description,"terminor input laser* is null index:%d, terminor id:%d",i,m_terminor_parameter.id());
|
|
|
+ return Error_manager(TERMINOR_INPUT_LASER_NULL,NORMAL,description);
|
|
|
}
|
|
|
}
|
|
|
if(plc==0)
|
|
|
{
|
|
|
- LOG(ERROR)<<"terminor input plc* is null terminor id:"<<m_terminor_parameter.id();
|
|
|
- return TERMINOR_INPUT_PLC_NULL;
|
|
|
+ char description[255]={0};
|
|
|
+ sprintf(description,"terminor input plc* is null terminor id:%d",m_terminor_parameter.id());
|
|
|
+ return Error_manager(TERMINOR_INPUT_PLC_NULL,NORMAL,description);
|
|
|
}
|
|
|
if(locater==0)
|
|
|
{
|
|
|
- LOG(ERROR)<<"terminor input locater* is null terminor id:"<<m_terminor_parameter.id();
|
|
|
- return TERMINOR_INPUT_LOCATER_NULL;
|
|
|
+ char description[255]={0};
|
|
|
+ sprintf(description,"terminor input locater* is null terminor id:%d",m_terminor_parameter.id());
|
|
|
+ return Error_manager(TERMINOR_INPUT_LOCATER_NULL,NORMAL,description);
|
|
|
}
|
|
|
|
|
|
//第二步,雷达,plc以及定位模块是否能正常接收指令;
|
|
@@ -126,8 +129,9 @@ Error_manager Terminor_Command_Executor::execute_command(std::vector<Laser_base*
|
|
|
std::lock_guard<std::mutex> t_lock(m_mutex_lock);
|
|
|
if(get_terminor_statu()!=TERMINOR_READY)
|
|
|
{
|
|
|
- LOG(ERROR)<<"terminor is not ready, terminor id:"<<m_terminor_parameter.id();
|
|
|
- return TERMINOR_NOT_READY;
|
|
|
+ char description[255]={0};
|
|
|
+ sprintf(description,"terminor is not ready, terminor id:%d",m_terminor_parameter.id());
|
|
|
+ return Error_manager(TERMINOR_NOT_READY,NORMAL,description);
|
|
|
}
|
|
|
//检查上次线程是否退出,并等待线程退出
|
|
|
if(mp_command_thread!=0)
|
|
@@ -148,7 +152,7 @@ Error_manager Terminor_Command_Executor::execute_command(std::vector<Laser_base*
|
|
|
mp_command_thread=new std::thread(thread_command_working,this);
|
|
|
if(mp_command_thread==0)
|
|
|
{
|
|
|
- return TERMINOR_CREATE_WORKING_THREAD_FAILED;
|
|
|
+ return Error_manager(TERMINOR_CREATE_WORKING_THREAD_FAILED,NORMAL,"terminor create thread failed");
|
|
|
}
|
|
|
return SUCCESS;
|
|
|
}
|