|
@@ -119,100 +119,6 @@ int main(int argc,char* argv[])
|
|
|
FLAGS_stop_logging_if_full_disk = true;
|
|
|
|
|
|
|
|
|
-
|
|
|
- // Dispatch_communication_test dispatchCommunicationTest;
|
|
|
-// dispatchCommunicationTest.communication_init();
|
|
|
-// std::this_thread::sleep_for(std::chrono::seconds(1));
|
|
|
-
|
|
|
-
|
|
|
- nnxx::socket socket{nnxx::SP, nnxx::BUS};
|
|
|
-//
|
|
|
-
|
|
|
- socket.bind("tcp://192.168.2.168:30000");
|
|
|
- std::this_thread::sleep_for(std::chrono::seconds(1));
|
|
|
-//
|
|
|
-
|
|
|
-// socket.send(sendMsg(1, 79, 7.755, "12345678901234567890123456_s1_wU", message::Dispatch_motion_direction::E_STORE_CAR));
|
|
|
-// socket.send(sendMsg(2, 78, 11.055, "12345678901234567890123456_s2_wU", message::Dispatch_motion_direction::E_STORE_CAR));
|
|
|
-// socket.send(sendMsg(3, 79, 14.655, "12345678901234567890123456_s3_wU", message::Dispatch_motion_direction::E_STORE_CAR));
|
|
|
-
|
|
|
-
|
|
|
-// socket.send(sendMsg(4, 39, 17.955, "12345678901234567890123456_s4_wU", message::Dispatch_motion_direction::E_STORE_CAR));
|
|
|
-// socket.send(sendMsg(5, 40, 21.555, "12345678901234567890123456_s5_wU", message::Dispatch_motion_direction::E_STORE_CAR));
|
|
|
-// socket.send(sendMsg(6, 27, 24.855, "12345678901234567890123456_s6_wU", message::Dispatch_motion_direction::E_STORE_CAR));
|
|
|
-
|
|
|
-// socket.send(sendMsg(1, 79, 7.755, "12345678901234567890123456_p1_wU", message::Dispatch_motion_direction::E_PICKUP_CAR));
|
|
|
- socket.send(sendMsg(2, 37, 11.055, "12345678901234567890123456_p2_wU", message::Dispatch_motion_direction::E_PICKUP_CAR));
|
|
|
- socket.send(sendMsg(3, 36, 14.655, "12345678901234567890123456_p3_wU", message::Dispatch_motion_direction::E_PICKUP_CAR));
|
|
|
- socket.send(sendMsg(4, 19, 17.955, "12345678901234567890123456_p4_wU", message::Dispatch_motion_direction::E_PICKUP_CAR));
|
|
|
-
|
|
|
- socket.send(sendMsg(5, 39, 21.555, "12345678901234567890123456_p5_wU", message::Dispatch_motion_direction::E_PICKUP_CAR));
|
|
|
- socket.send(sendMsg(6, 40, 24.855, "12345678901234567890123456_p6_wU", message::Dispatch_motion_direction::E_PICKUP_CAR));
|
|
|
-// socket.send(sendMsg(7, 39, 24.855, "12345678901234567890123456_p7_wU", message::Dispatch_motion_direction::E_PICKUP_CAR));
|
|
|
-
|
|
|
-// std::this_thread::sleep_for(std::chrono::seconds(5));
|
|
|
-////
|
|
|
-//
|
|
|
-// message::Dispatch_control_request_msg control_reqeust;
|
|
|
-// control_reqeust.mutable_base_info()->set_msg_type(message::eDispatch_control_request_msg);
|
|
|
-// control_reqeust.mutable_base_info()->set_sender(message::eDispatch_control);
|
|
|
-// control_reqeust.mutable_base_info()->set_receiver(message::eDispatch_manager);
|
|
|
-// control_reqeust.mutable_base_info()->set_timeout_ms(100000000);
|
|
|
-// control_reqeust.set_command_key("12345678901234567890123456_p5_wU+120");
|
|
|
-// control_reqeust.set_dispatch_task_type(message::ROBOT_MOVE);
|
|
|
-// control_reqeust.set_dispatch_device_type(message::ROBOT_2);
|
|
|
-// control_reqeust.set_dispatch_source(0);
|
|
|
-// control_reqeust.set_dispatch_destination(1403);
|
|
|
-// LOG(INFO) << control_reqeust.DebugString();
|
|
|
-// socket.send(control_reqeust.SerializeAsString());
|
|
|
-
|
|
|
- while (1)
|
|
|
- {
|
|
|
- std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
|
|
- std::string str;
|
|
|
- message::Base_msg base_info;
|
|
|
-
|
|
|
- str=socket.recv<std::string>(1);
|
|
|
-
|
|
|
- if ( str.size() > 0 )
|
|
|
- {
|
|
|
- base_info.ParseFromString(str);
|
|
|
- if ( base_info.base_info().msg_type() == message::eDispatch_manager_status_msg )
|
|
|
- {
|
|
|
-// std::cout << " Time_tool::get_instance_references().get_current_time_millisecond() = " << Time_tool::get_instance_references().get_current_time_millisecond() << std::endl;
|
|
|
-// std::cout <<base_info.DebugString()<< std::endl;
|
|
|
- }
|
|
|
- else if ( base_info.base_info().msg_type() == message::eDispatch_control_response_msg )
|
|
|
- {
|
|
|
- message::Dispatch_control_response_msg t_dispatch_control_response_msg;
|
|
|
- t_dispatch_control_response_msg.ParseFromString(str);
|
|
|
- if ( t_dispatch_control_response_msg.dispatch_device_task_status() == message::Dispatch_device_task_status::E_TASK_OVER)
|
|
|
- {
|
|
|
- std::cout << " Time_tool::get_instance_references().get_current_time_millisecond() = " << Time_tool::get_instance_references().get_current_time_millisecond() << std::endl;
|
|
|
- std::cout <<t_dispatch_control_response_msg.DebugString()<< std::endl;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- std::cout << " Time_tool::get_instance_references().get_current_time_millisecond() = " << Time_tool::get_instance_references().get_current_time_millisecond() << std::endl;
|
|
|
- std::cout <<t_dispatch_control_response_msg.DebugString()<< std::endl;
|
|
|
- }
|
|
|
- }
|
|
|
- else if ( base_info.base_info().msg_type() == message::eDispatch_control_request_msg )
|
|
|
- {
|
|
|
- message::Dispatch_control_request_msg t_dispatch_control_request_msg;
|
|
|
- t_dispatch_control_request_msg.ParseFromString(str);
|
|
|
- std::cout << " Time_tool::get_instance_references().get_current_time_millisecond() = " << Time_tool::get_instance_references().get_current_time_millisecond() << std::endl;
|
|
|
-
|
|
|
- std::cout <<t_dispatch_control_request_msg.DebugString()<< std::endl;
|
|
|
- }
|
|
|
- else
|
|
|
- { std::cout << " Time_tool::get_instance_references().get_current_time_millisecond() = " << Time_tool::get_instance_references().get_current_time_millisecond() << std::endl;
|
|
|
-
|
|
|
- std::cout <<base_info.DebugString()<< std::endl;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
#define MAIN_TEST 1
|
|
|
#ifdef MAIN_TEST
|
|
|
t_error = Dispatch_coordinates::get_instance_references().dispatch_coordinates_init();
|