|
@@ -174,6 +174,7 @@ void Dispatch_plc::execute_thread_fun()
|
|
|
//判断2个出口是否空闲
|
|
|
if ( Dispatch_manager::get_instance_references().m_dispatch_singlechip[2].is_outlet_ready() )
|
|
|
{
|
|
|
+ m_outlet_id = 0;
|
|
|
//封装 给plc的调度请求
|
|
|
m_result = encapsulate_dispatch_request_to_plc(0);
|
|
|
if ( m_result == Error_code::SUCCESS )
|
|
@@ -187,6 +188,7 @@ void Dispatch_plc::execute_thread_fun()
|
|
|
}
|
|
|
else if ( Dispatch_manager::get_instance_references().m_dispatch_singlechip[3].is_outlet_ready() )
|
|
|
{
|
|
|
+ m_outlet_id = 1;
|
|
|
//封装 给plc的调度请求
|
|
|
m_result = encapsulate_dispatch_request_to_plc(1);
|
|
|
if ( m_result == Error_code::SUCCESS )
|
|
@@ -567,7 +569,19 @@ Error_manager Dispatch_plc::send_dispatch_response_to_main_control()
|
|
|
m_dispatch_response_msg.set_command_key(m_dispatch_request_msg.command_key());
|
|
|
|
|
|
m_dispatch_response_msg.set_dispatch_motion_direction(m_dispatch_request_msg.dispatch_motion_direction());
|
|
|
- m_dispatch_response_msg.set_terminal_id(m_dispatch_request_msg.terminal_id());
|
|
|
+
|
|
|
+ //need,need
|
|
|
+ if ( m_dispatch_request_msg.dispatch_motion_direction() == message::Dispatch_motion_direction::E_STORE_CAR )
|
|
|
+ {
|
|
|
+ m_dispatch_response_msg.set_terminal_id(m_dispatch_request_msg.terminal_id());
|
|
|
+
|
|
|
+ }
|
|
|
+ else if( m_dispatch_request_msg.dispatch_motion_direction() == message::Dispatch_motion_direction::E_PICKUP_CAR )
|
|
|
+ {
|
|
|
+ m_dispatch_response_msg.set_terminal_id(m_dispatch_request_msg.terminal_id()*2+m_outlet_id);
|
|
|
+ }
|
|
|
+
|
|
|
+// m_dispatch_response_msg.set_terminal_id(m_dispatch_request_msg.terminal_id());
|
|
|
m_dispatch_response_msg.mutable_locate_information()->CopyFrom(m_dispatch_request_msg.locate_information());
|
|
|
m_dispatch_response_msg.mutable_parkspace_info_ex()->CopyFrom(m_dispatch_request_msg.parkspace_info_ex());
|
|
|
m_dispatch_response_msg.set_car_type(m_dispatch_request_msg.car_type());
|