|
@@ -9,7 +9,7 @@
|
|
Dispatch_process::Dispatch_process()
|
|
Dispatch_process::Dispatch_process()
|
|
{
|
|
{
|
|
m_dispatch_process_status = DISPATCH_PROCESS_STATUS_UNKNOW;
|
|
m_dispatch_process_status = DISPATCH_PROCESS_STATUS_UNKNOW;
|
|
- m_dispatch_process_type = DISPATCH_PROCESS_TYPE_UNKNOW;
|
|
|
|
|
|
+ m_dispatch_process_type = Common_data::Dispatch_process_type::DISPATCH_PROCESS_TYPE_UNKNOW;
|
|
m_dispatch_source = 0;
|
|
m_dispatch_source = 0;
|
|
m_dispatch_destination = 0;
|
|
m_dispatch_destination = 0;
|
|
m_wheel_base = 0;
|
|
m_wheel_base = 0;
|
|
@@ -23,6 +23,7 @@ Dispatch_process::~Dispatch_process()
|
|
//初始化, 就把主控发送的请求传入即可.
|
|
//初始化, 就把主控发送的请求传入即可.
|
|
Error_manager Dispatch_process::Dispatch_process_init(message::Dispatch_request_msg &dispatch_request_msg)
|
|
Error_manager Dispatch_process::Dispatch_process_init(message::Dispatch_request_msg &dispatch_request_msg)
|
|
{
|
|
{
|
|
|
|
+ //设定超时时间, 默认比任务指令里面的时间少10秒,
|
|
if ( dispatch_request_msg.base_info().has_timeout_ms() )
|
|
if ( dispatch_request_msg.base_info().has_timeout_ms() )
|
|
{
|
|
{
|
|
m_timeout_ms = dispatch_request_msg.base_info().timeout_ms() - DISPATCH_PROCESS_ATTENUATION_TIMEOUT_MS;
|
|
m_timeout_ms = dispatch_request_msg.base_info().timeout_ms() - DISPATCH_PROCESS_ATTENUATION_TIMEOUT_MS;
|
|
@@ -58,13 +59,14 @@ Error_manager Dispatch_process::Dispatch_process_init(message::Dispatch_request_
|
|
return Error_manager(Error_code::DISPATCH_PROCESS_INIT_ERROR, Error_level::MINOR_ERROR,
|
|
return Error_manager(Error_code::DISPATCH_PROCESS_INIT_ERROR, Error_level::MINOR_ERROR,
|
|
" dispatch_request_msg.parkspace_info_ex_size() is error ");
|
|
" dispatch_request_msg.parkspace_info_ex_size() is error ");
|
|
}
|
|
}
|
|
|
|
+ //检查定位信息
|
|
if ( dispatch_request_msg.has_locate_information() == false )
|
|
if ( dispatch_request_msg.has_locate_information() == false )
|
|
{
|
|
{
|
|
return Error_manager(Error_code::DISPATCH_PROCESS_INIT_ERROR, Error_level::MINOR_ERROR,
|
|
return Error_manager(Error_code::DISPATCH_PROCESS_INIT_ERROR, Error_level::MINOR_ERROR,
|
|
" dispatch_request_msg.has_locate_information() is error ");
|
|
" dispatch_request_msg.has_locate_information() is error ");
|
|
}
|
|
}
|
|
|
|
|
|
- m_dispatch_process_type = DISPATCH_PROCESS_STORE;
|
|
|
|
|
|
+ m_dispatch_process_type = Common_data::Dispatch_process_type::DISPATCH_PROCESS_STORE;
|
|
m_dispatch_source = dispatch_request_msg.terminal_id() + PASSAGEWAY_ID_BASE ;
|
|
m_dispatch_source = dispatch_request_msg.terminal_id() + PASSAGEWAY_ID_BASE ;
|
|
//终点在运动过程中动态分配
|
|
//终点在运动过程中动态分配
|
|
// m_dispatch_destination = dispatch_request_msg.parkspace_info().parkingspace_index_id() + PARKSPACE_ID_BASE;
|
|
// m_dispatch_destination = dispatch_request_msg.parkspace_info().parkingspace_index_id() + PARKSPACE_ID_BASE;
|
|
@@ -90,7 +92,7 @@ Error_manager Dispatch_process::Dispatch_process_init(message::Dispatch_request_
|
|
" dispatch_request_msg.parkspace_info_ex_size() is error ");
|
|
" dispatch_request_msg.parkspace_info_ex_size() is error ");
|
|
}
|
|
}
|
|
|
|
|
|
- m_dispatch_process_type = DISPATCH_PROCESS_PICKUP;
|
|
|
|
|
|
+ m_dispatch_process_type = Common_data::Dispatch_process_type::DISPATCH_PROCESS_PICKUP;
|
|
m_dispatch_source = dispatch_request_msg.parkspace_info().parkingspace_index_id() + PARKSPACE_ID_BASE;
|
|
m_dispatch_source = dispatch_request_msg.parkspace_info().parkingspace_index_id() + PARKSPACE_ID_BASE;
|
|
//终点在运动过程中动态分配
|
|
//终点在运动过程中动态分配
|
|
//目前不控制门, 所以出口有主控决定. 如果后续控制门, 那么出口可以由调度决定.
|
|
//目前不控制门, 所以出口有主控决定. 如果后续控制门, 那么出口可以由调度决定.
|
|
@@ -101,7 +103,7 @@ Error_manager Dispatch_process::Dispatch_process_init(message::Dispatch_request_
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- m_dispatch_process_type = DISPATCH_PROCESS_TYPE_UNKNOW;
|
|
|
|
|
|
+ m_dispatch_process_type = Common_data::Dispatch_process_type::DISPATCH_PROCESS_TYPE_UNKNOW;
|
|
return Error_manager(Error_code::DISPATCH_PROCESS_INIT_ERROR, Error_level::MINOR_ERROR,
|
|
return Error_manager(Error_code::DISPATCH_PROCESS_INIT_ERROR, Error_level::MINOR_ERROR,
|
|
" Dispatch_process::Dispatch_process_init ERROR ");
|
|
" Dispatch_process::Dispatch_process_init ERROR ");
|
|
}
|
|
}
|
|
@@ -259,7 +261,7 @@ void Dispatch_process::Main()
|
|
//检查调度请求
|
|
//检查调度请求
|
|
Error_manager Dispatch_process::check_dispatch_request_msg()
|
|
Error_manager Dispatch_process::check_dispatch_request_msg()
|
|
{
|
|
{
|
|
- std::unique_lock<std::mutex> t_lock(m_lock);
|
|
|
|
|
|
+// std::unique_lock<std::mutex> t_lock(m_lock);
|
|
return Error_code::SUCCESS;
|
|
return Error_code::SUCCESS;
|
|
}
|
|
}
|
|
|
|
|