Browse Source

20210619, 调度流程 多车

huli 4 years ago
parent
commit
9bfabe8971

+ 2 - 29
dispatch/carrier.cpp

@@ -359,7 +359,7 @@ Error_manager Carrier::cancel_command()
 Error_manager Carrier::update_actual_coordinates_id()
 {
 	Dispatch_coordinates * tp_dispatch_coordinates = Dispatch_coordinates::get_instance_pointer();
-	float t_distance_min = 999999;
+	float t_distance_min = 99999999999999999;
 	float t_distance_current = 0;
 	int t_index_min = 0;
 
@@ -384,38 +384,11 @@ Error_manager Carrier::update_actual_coordinates_id()
 		//3楼的搬运器不用加空间锁
 		if ( get_device_id() != 2 )
 		{
+
 			Dispatch_coordinates::get_instance_references().set_space_lock_for_carrier(m_actual_coordinates_rows, m_actual_coordinates_columns, m_device_id);
 		}
 	}
 
-
-
-
-//	if ( get_device_id() == 2 )
-//	{
-//		for (auto iter = tp_dispatch_coordinates->m_carrier_coordinates.begin(); iter != tp_dispatch_coordinates->m_carrier_coordinates.end(); ++iter)
-//		{
-//			if ( Common_data::approximate_difference(m_actual_x, iter->second.x, 100) &&
-//				 Common_data::approximate_difference(m_actual_y, iter->second.y, 500)  &&
-//				 Common_data::approximate_difference(tp_dispatch_coordinates->m_carrier_3th_floor_z, iter->second.z, 200) )
-//			{
-//				m_actual_coordinates_id = iter->first;
-//			}
-//		}
-//	}
-//	else
-//	{
-//		for (auto iter = tp_dispatch_coordinates->m_carrier_coordinates.begin(); iter != tp_dispatch_coordinates->m_carrier_coordinates.end(); ++iter)
-//		{
-//			if ( Common_data::approximate_difference(m_actual_x, iter->second.x, 100) &&
-//				 Common_data::approximate_difference(m_actual_y, iter->second.y, 500) &&
-//				 Common_data::approximate_difference(m_actual_z, iter->second.z, 200) )
-//			{
-//				m_actual_coordinates_id = iter->first;
-//			}
-//		}
-//	}
-
 	return Error_code::SUCCESS;
 }
 

+ 0 - 10
dispatch/catcher.cpp

@@ -374,16 +374,6 @@ Error_manager Catcher::update_actual_coordinates_id()
 		Dispatch_coordinates::get_instance_references().catcher_4st_floor_space_lock(m_actual_coordinates_columns, m_device_id);
 	}
 
-//	for (auto iter = tp_dispatch_coordinates->m_catcher_coordinates.begin(); iter != tp_dispatch_coordinates->m_catcher_coordinates.end(); ++iter)
-//	{
-//		if ( Common_data::approximate_difference(m_actual_x, iter->second.x, 100) &&
-//			 Common_data::approximate_difference(m_actual_y, iter->second.y, 500) &&
-//			 Common_data::approximate_difference(m_actual_z, iter->second.z, 200) )
-//		{
-//			m_actual_coordinates_id = iter->first;
-//		}
-//	}
-
 	return Error_code::SUCCESS;
 }
 

+ 32 - 15
dispatch/dispatch_coordinates.cpp

@@ -428,12 +428,7 @@ Error_manager Dispatch_coordinates::carrier_try_space_lock(int row_min, int colu
 		{
 			for (int j = column_min; j <= column_max ; ++j)
 			{
-				if ( mpp_space_lock[i][j].m_carrier_id != -1 &&
-					 mpp_space_lock[i][j].m_carrier_id != carrier_id &&
-					 mpp_space_lock[i][j].m_catcher_id != -1)
-				{
-					mpp_space_lock[i][j].m_carrier_id = carrier_id;
-				}
+				mpp_space_lock[i][j].m_carrier_id = carrier_id;
 			}
 		}
 	    return Error_code::SUCCESS;
@@ -469,12 +464,7 @@ Error_manager Dispatch_coordinates::catcher_try_space_lock(int row_min, int colu
 		{
 			for (int j = column_min; j <= column_max ; ++j)
 			{
-				if ( mpp_space_lock[i][j].m_catcher_id != -1 &&
-					 mpp_space_lock[i][j].m_catcher_id != catcher_id &&
-					 mpp_space_lock[i][j].m_carrier_id != -1)
-				{
-					mpp_space_lock[i][j].m_catcher_id = catcher_id;
-				}
+				mpp_space_lock[i][j].m_catcher_id = catcher_id;
 			}
 		}
 		return Error_code::SUCCESS;
@@ -521,9 +511,9 @@ Error_manager Dispatch_coordinates::carrier_space_unlock(int carrier_id)
 	{
 		for (int j = 0; j < m_space_lock_columns ; ++j)
 		{
-			if ( mpp_space_lock[i][j].m_catcher_id == carrier_id )
+			if ( mpp_space_lock[i][j].m_carrier_id == carrier_id )
 			{
-				mpp_space_lock[i][j].m_catcher_id = -1;
+				mpp_space_lock[i][j].m_carrier_id = -1;
 			}
 		}
 	}
@@ -609,4 +599,31 @@ void Dispatch_coordinates::set_space_lock_for_carrier(int space_id, int carrier_
 	int space_columns = (space_id-1) % m_space_lock_columns;
 	set_space_lock_for_carrier(space_rows, space_columns, carrier_id);
 }
-
+void Dispatch_coordinates::cout_space_lock()
+{
+	std::unique_lock<std::mutex> t_lock(m_lock);
+	std::cout << " huli test :::: " << " Dispatch_coordinates::cout_space_lock() = " << "mpp_space_lock" << std::endl;
+	for (int i = m_space_lock_rows-1; i >=0; --i)
+	{
+		for (int j = m_space_lock_columns-1; j >=0  ; --j)
+		{
+			if ( mpp_space_lock[i][j].m_carrier_id == -1 )
+			{
+				printf("( _");
+			}
+			else
+			{
+				printf("(%d_", mpp_space_lock[i][j].m_carrier_id);
+			}
+			if ( mpp_space_lock[i][j].m_catcher_id == -1 )
+			{
+				printf(" )    ");
+			}
+			else
+			{
+				printf("%d)    ", mpp_space_lock[i][j].m_catcher_id);
+			}
+		}
+		std::cout << std::endl;
+	}
+}

+ 2 - 0
dispatch/dispatch_coordinates.h

@@ -106,6 +106,8 @@ public://get or set member variable
 	void set_space_lock_for_catcher(int space_id, int catcher_id);
 	void set_space_lock_for_carrier(int space_id, int carrier_id);
 
+	void cout_space_lock();
+
 protected://member functions
 
 public://member variable

+ 98 - 8
dispatch/dispatch_device_base.cpp

@@ -115,7 +115,65 @@ Error_manager Dispatch_device_base::execute_task(std::shared_ptr<Task_Base> p_ta
 
 	return Error_code::SUCCESS;
 }
+//执行任务//注意了, 调度任务允许同时接受多个任务
+Error_manager Dispatch_device_base::execute_task(std::shared_ptr<Task_Base> p_task, Dispatch_task_level dispatch_task_level, std::string command_key, Common_data::Dispatch_process_type process_type)
+{
+	LOG(INFO) << " ---Dispatch_device_base::execute_task ---"<< this;
+
+	Error_manager t_error;
+	Error_manager t_result;
+
+	//检查指针
+	if (p_task.get() == NULL) {
+		return Error_manager(Error_code::POINTER_IS_NULL, Error_level::MINOR_ERROR,
+							 "Dispatch_device_base::execute_task failed, POINTER_IS_NULL");
+	}
+	//检查任务类型,
+
+
+	t_error = check_task_type(p_task);
+	if ( t_error != Error_code::SUCCESS )
+	{
+		return t_error;
+	}
+
+	//检查接收方能否接受任务
+	t_error = check_task_level(dispatch_task_level);
+	if ( t_error != SUCCESS )
+	{
+		t_result.compare_and_cover_error(t_error);
+	}
+	else
+	{
+		//接受任务,并将任务的状态改为TASK_SIGNED已签收
+		t_error = sign_for_task(p_task, dispatch_task_level, command_key, process_type);
+		if ( t_error != Error_code::SUCCESS )
+		{
+			return t_error;
+		}
+		//这里不用检查任务内容, 直接下发给底层设备
+		//永远启动到三级任务工作状态.
+		// 启动定位管理模块,的核心工作线程
+		m_dispatch_device_status = DISPATCH_DEVICE_THREE_LEVEL_WORK;
+		m_execute_condition.notify_all(true);
+		//通知 thread_work 子线程启动。
+		//只签收,并不一定进入工作状态, 在线程真正的执行的时候,才改为工作中, (执行线程可能会先处理更高优先级的任务单)
+
+		//当接受2级任务时, 标记位改为true
+		if ( dispatch_task_level == DISPATCH_TASK_TWO_LEVEL )
+		{
+			m_break_flag = true;
+		}
+
+	}
 
+	if ( t_result != Error_code::SUCCESS )
+	{
+		return t_result;
+	}
+
+	return Error_code::SUCCESS;
+}
 //检查任务类型, 子类必须重载, 用来检查输入的任务是否为子类所需的.
 Error_manager Dispatch_device_base::check_task_type(std::shared_ptr<Task_Base> p_task)
 {
@@ -258,6 +316,46 @@ Error_manager Dispatch_device_base::sign_for_task(std::shared_ptr<Task_Base> p_t
 	}
 	return Error_code::SUCCESS;
 }
+//签收任务 覆盖预约
+Error_manager Dispatch_device_base::sign_for_task(std::shared_ptr<Task_Base> p_task, Dispatch_task_level dispatch_task_level, std::string command_key, Common_data::Dispatch_process_type process_type)
+{
+	//加锁
+	std::unique_lock<std::mutex> t_lock(m_lock);
+	switch ( dispatch_task_level )
+	{
+		case DISPATCH_TASK_ONE_LEVEL:
+		{
+			m_device_one_level_command_key = command_key;
+			m_device_one_level_process_type = process_type;
+			mp_device_one_level_task = p_task;
+			mp_device_one_level_task->set_task_statu(Task_Base::Task_statu::TASK_SIGNED);
+			break;
+		}
+		case DISPATCH_TASK_TWO_LEVEL:
+		{
+			m_device_two_level_command_key = command_key;
+			m_device_two_level_process_type = process_type;
+			mp_device_two_level_task = p_task;
+			mp_device_two_level_task->set_task_statu(Task_Base::Task_statu::TASK_SIGNED);
+			break;
+		}
+		case DISPATCH_TASK_THREE_LEVEL:
+		{
+			m_device_three_level_command_key = command_key;
+			m_device_three_level_process_type = process_type;
+			mp_device_three_level_task = p_task;
+			mp_device_three_level_task->set_task_statu(Task_Base::Task_statu::TASK_SIGNED);
+			break;
+		}
+		default:
+		{
+			return Error_manager(Error_code::PARAMETER_ERROR, Error_level::MINOR_ERROR,
+								 "  Dispatch_device_base::check_task PARAMETER_ERROR ");
+			break;
+		}
+	}
+	return Error_code::SUCCESS;
+}
 
 //检查状态,是否正常运行. (工作状态 和 是否能接受对应的任务无关)
 Error_manager Dispatch_device_base::check_status()
@@ -784,14 +882,6 @@ void Dispatch_device_base::execute_thread_fun()
 							m_device_two_level_command_key.clear();
 							m_device_two_level_process_type = Common_data::Dispatch_process_type::DISPATCH_PROCESS_TYPE_UNKNOW;
 							m_dispatch_device_status = DISPATCH_DEVICE_ONE_LEVEL_WORK;
-
-							std::cout << " huli test :::: " << " 1111111111111111111555555555555555555555555555555555555555555555555555555555555555555555555555 = " << 15 << std::endl;
-							std::cout << " huli test :::: " << " 111111111111111111155555555555555555555555555555555 = " << 15 << std::endl;
-
-							std::cout << " huli test :::: " << " get_device_id() = " << get_device_id() << std::endl;
-
-							std::cout << " huli test :::: " << " 111111111111111111155555555555555555555555555555555 = " << 15 << std::endl;
-							std::cout << " huli test :::: " << " 1111111111111111111555555555555555555555555555555555555555555555555555555555555555555555555555 = " << 15 << std::endl;
 						}
 							//任务单重新创建, 调度创建的新的任务,那么回去继续工作
 						else if (  mp_device_two_level_task->get_task_statu() == Task_Base::Task_statu::TASK_CREATED )

+ 6 - 0
dispatch/dispatch_device_base.h

@@ -181,12 +181,17 @@ public://API functions
 
 	//执行任务//注意了, 调度任务允许同时接受多个任务
 	virtual Error_manager execute_task(std::shared_ptr<Task_Base> p_task, Dispatch_task_level dispatch_task_level);
+	//执行任务//注意了, 调度任务允许同时接受多个任务
+	virtual Error_manager execute_task(std::shared_ptr<Task_Base> p_task, Dispatch_task_level dispatch_task_level, std::string command_key, Common_data::Dispatch_process_type process_type);
+
 	//检查任务类型, 子类必须重载, 用来检查输入的任务是否为子类所需的.
 	virtual Error_manager check_task_type(std::shared_ptr<Task_Base> p_task);
 	//判断能否执行任务
 	virtual Error_manager check_task_level(Dispatch_task_level dispatch_task_level);
 	//签收任务
 	virtual Error_manager sign_for_task(std::shared_ptr<Task_Base> p_task, Dispatch_task_level dispatch_task_level);
+	//签收任务 覆盖预约
+	virtual Error_manager sign_for_task(std::shared_ptr<Task_Base> p_task, Dispatch_task_level dispatch_task_level, std::string command_key, Common_data::Dispatch_process_type process_type);
 
 	//检查状态,是否正常运行. (工作状态 和 是否能接受对应的任务无关)
 	virtual Error_manager check_status();
@@ -247,6 +252,7 @@ protected://member functions
 
 
 protected://member variable
+public:
 	std::atomic<Dispatch_device_status>			m_dispatch_device_status;			//设备总状态, 控制任务流程(长流程)
 	int 								m_device_id;				//设备id, 索引
 	int 								m_device_key;				//设备唯一码, 自定义

File diff suppressed because it is too large
+ 270 - 248
dispatch/dispatch_process.cpp


+ 1 - 3
dispatch/dispatch_process.h

@@ -1,7 +1,5 @@
 
-//#define MAIN_TEST 1
-//#define PROCESS_TEST 1
-#define TIME_TEST 1
+
 
 
 /*

+ 3 - 1
error_code/error_code.h

@@ -5,7 +5,9 @@
 //用法:所有的功能接口函数return错误管理类,
 //然后上层判断分析错误码,并进行故障处理。
 
-
+#define MAIN_TEST 1
+//#define PROCESS_TEST 1
+#define TIME_TEST 1
 
 #ifndef TEST_ERROR_ERROR_CODE_H
 #define TEST_ERROR_ERROR_CODE_H

+ 26 - 303
main.cpp

@@ -102,27 +102,27 @@ int main(int argc,char* argv[])
 	System_communication::get_instance_references().communication_init();
 	System_communication::get_instance_references().set_encapsulate_cycle_time(1000);
 
+	std::this_thread::sleep_for(std::chrono::seconds(1));
+	Dispatch_coordinates::get_instance_references().cout_space_lock();
+
+	Dispatch_coordinates * tp_dispatch_coordinates = Dispatch_coordinates::get_instance_pointer();
+	int t_avoid_catcher_id=-1;
+	t_error = Dispatch_coordinates::get_instance_references().carrier_try_space_lock(0, 7-1,
+																					  0, tp_dispatch_coordinates->m_space_lock_columns-1,
+																					  1, t_avoid_catcher_id);
+	t_error = Dispatch_coordinates::get_instance_references().carrier_try_space_lock(3, 0,
+																					 3, 7-1,
+																					 0, t_avoid_catcher_id);
+
+	Dispatch_coordinates::get_instance_references().cout_space_lock();
+	tp_dispatch_coordinates->carrier_space_unlock(0);
+	Dispatch_coordinates::get_instance_references().cout_space_lock();
+	tp_dispatch_coordinates->carrier_space_unlock(1);
+	Dispatch_coordinates::get_instance_references().cout_space_lock();
+
+
 	while (1)
 	{
-//		Dispatch_manager::space_device** tpp = Dispatch_manager::get_instance_references().mpp_space_lock;
-//		for (int i = 0; i < 11; ++i)
-//		{
-//			for (int j = 0; j < 15; ++j)
-//			{
-//				if ( tpp[i][j].m_catcher_id  != -1 )
-//				{
-//					std::cout << " huli test :::: " << " tpp[i][j].m_catcher_id = " << tpp[i][j].m_catcher_id << std::endl;
-//					std::cout << " huli test :::: " << " i = " << i << std::endl;
-//					std::cout << " huli test :::: " << " j = " << j << std::endl;
-//				}
-//				if ( tpp[i][j].m_carrier_id  != -1 )
-//				{
-//					std::cout << " huli test :::: " << " tpp[i][j].m_carrier_id = " << tpp[i][j].m_carrier_id << std::endl;
-//					std::cout << " huli test :::: " << " i = " << i << std::endl;
-//					std::cout << " huli test :::: " << " j = " << j << std::endl;
-//				}
-//			}
-//		}
 
 		std::this_thread::sleep_for(std::chrono::seconds(1));
 	}
@@ -158,21 +158,16 @@ int main(int argc,char* argv[])
 
 
 
-
-
-
-
 	Catcher t_catcher;
 	t_error = t_catcher.dispatch_device_base_init(1, 102);
 	std::cout << " huli test :::: " << " t_error = " << t_error << std::endl;
-	std::this_thread::sleep_for(std::chrono::seconds(2));
-
+	std::this_thread::sleep_for(std::chrono::milliseconds(2));
 
 	std::shared_ptr<Task_Base> tp_task_Base1(new Catcher_task);
 	Catcher_task * tp_catcher_task1 = (Catcher_task *)tp_task_Base1.get();
 	tp_catcher_task1->task_init(NULL,std::chrono::milliseconds(15000));
 	tp_catcher_task1->m_request_key = "x23456789012345678901234567890r1";
-	tp_catcher_task1->m_request_x = 17955;
+	tp_catcher_task1->m_request_x = 7755;
 	tp_catcher_task1->m_request_y = 3000;
 	tp_catcher_task1->m_request_b = 90;
 	tp_catcher_task1->m_request_z = 5410;
@@ -184,80 +179,12 @@ int main(int argc,char* argv[])
 	std::cout << " huli test :::: " << " t_error = " << t_error << std::endl;
 	std::cout << " ---------------------------------------------------" << std::endl;
 
-	
-	/*
-	char zxczxcxzc1 ;
-	std::cin >> zxczxcxzc1 ;
-	while ( 1 )
-	{
-		std::cout << " huli test :::: " << "  ===================================== "   << std::endl;
-		std::cout << " huli test :::: " << " tp_catcher_task->get_task_statu = " << tp_catcher_task->get_task_statu() << std::endl;
-		std::cout << " huli test :::: " << " tp_catcher_task->m_respons_status = " << tp_catcher_task->m_respons_status << std::endl;
-
-		std::cout << " huli test :::: " << " m_respons_key = " << tp_catcher_task->m_respons_key << std::endl;
-		std::cout << " huli test :::: " << " m_respons_status = " << tp_catcher_task->m_respons_status << std::endl;
-		std::cout << " huli test :::: " << " m_respons_x = " << tp_catcher_task->m_respons_x << std::endl;
-		std::cout << " huli test :::: " << " m_respons_y = " << tp_catcher_task->m_respons_y << std::endl;
-		std::cout << " huli test :::: " << " m_respons_b = " << tp_catcher_task->m_respons_b << std::endl;
-		std::cout << " huli test :::: " << " m_respons_z = " << tp_catcher_task->m_respons_z << std::endl;
-		std::cout << " huli test :::: " << " m_respons_d1 = " << tp_catcher_task->m_respons_d1 << std::endl;
-		std::cout << " huli test :::: " << " m_respons_d2 = " << tp_catcher_task->m_respons_d2 << std::endl;
-		std::cout << " huli test :::: " << " m_respons_wheelbase = " << tp_catcher_task->m_respons_wheelbase << std::endl;
-		std::cout << " huli test :::: " << " m_respons_clamp_motion = " << tp_catcher_task->m_respons_clamp_motion << std::endl;
-		std::cout << " ---------------------------------------------------" << std::endl;
-
-
-
-
-		std::cout << " huli test :::: " << " *********************************************** = " << std::endl;
-		std::cout << " huli test :::: " << " t_carrier_base.get_carrier_status() = " << t_catcher.get_dispatch_device_status() << std::endl;
-		int heat = t_catcher.m_last_heartbeat;
-		std::cout << " huli test :::: " << " m_last_heartbeat = " << heat << std::endl;
-		std::cout << " huli test :::: " << " m_actual_device_status = " << t_catcher.m_actual_device_status << std::endl;
-		std::cout << " huli test :::: " << " m_actual_load_status = " << t_catcher.m_actual_load_status << std::endl;
-		std::cout << " huli test :::: " << " m_actual_x = " << t_catcher.m_actual_x << std::endl;
-		std::cout << " huli test :::: " << " m_actual_y = " << t_catcher.m_actual_y << std::endl;
-		std::cout << " huli test :::: " << " m_actual_b = " << t_catcher.m_actual_b << std::endl;
-		std::cout << " huli test :::: " << " m_actual_z = " << t_catcher.m_actual_z << std::endl;
-		std::cout << " huli test :::: " << " m_actual_d1 = " << t_catcher.m_actual_d1 << std::endl;
-		std::cout << " huli test :::: " << " m_actual_d2 = " << t_catcher.m_actual_d2 << std::endl;
-		std::cout << " huli test :::: " << " m_actual_clamp_motion1 = " << t_catcher.m_actual_clamp_motion1 << std::endl;
-		std::cout << " huli test :::: " << " m_actual_clamp_motion2 = " << t_catcher.m_actual_clamp_motion2 << std::endl;
-		std::cout << " huli test :::: " << " m_actual_clamp_motion3 = " << t_catcher.m_actual_clamp_motion3 << std::endl;
-		std::cout << " huli test :::: " << " m_actual_clamp_motion4 = " << t_catcher.m_actual_clamp_motion4 << std::endl;
-		std::cout << " huli test :::: " << " m_actual_error_code = " <<  std::endl;
-		for (int i = 0; i < 50; ++i)
-		{
-			printf("0x%x ", t_catcher.m_actual_error_code[i]);
-		}
-		std::cout <<  std::endl;
-
-		std::cout << " huli test :::: " << " m_actual_warning_code = " <<  std::endl;
-		for (int i = 0; i < 50; ++i)
-		{
-			printf("0x%x ", t_catcher.m_actual_warning_code[i]);
-		}
-		std::cout <<  std::endl;
-		std::cout << " huli test :::: " << " m_actual_error_description = " << t_catcher.m_actual_error_description << std::endl;
-
-		std::cout << " huli test :::: " << " *********************************************** = " << std::endl;
-
-
-
-
-		std::this_thread::sleep_for(std::chrono::milliseconds(1000));
-
-	}
-*/
-
-
-
 
 
 	Carrier t_carrier20;
 	t_error = t_carrier20.dispatch_device_base_init(0, 200);
 	std::cout << " huli test :::: " << " t_error = " << t_error << std::endl;
-	std::this_thread::sleep_for(std::chrono::seconds(2));
+	std::this_thread::sleep_for(std::chrono::milliseconds(2));
 
 	std::shared_ptr<Task_Base> tp_task_Base20(new Carrier_task);
 	Carrier_task * tp_carrier_task20 = (Carrier_task *)tp_task_Base20.get();
@@ -280,80 +207,13 @@ int main(int argc,char* argv[])
 	std::cout << " huli test :::: " << " t_error = " << t_error << std::endl;
 	std::cout << " ---------------------------------------------------" << std::endl;
 
-	/*
-	char zxczxcxzc20 ;
-	std::cin >> zxczxcxzc20 ;
-	while ( 1 )
-	{
-		std::cout << " huli test :::: " << "  ===================================== "   << std::endl;
-		std::cout << " huli test :::: " << " tp_carrier_task->get_task_statu = " << tp_carrier_task->get_task_statu() << std::endl;
-		std::cout << " huli test :::: " << " tp_carrier_task->m_respons_status = " << tp_carrier_task->m_respons_status << std::endl;
-
-
-		std::cout << " huli test :::: " << " m_respons_key = " << tp_carrier_task->m_respons_key << std::endl;
-		std::cout << " huli test :::: " << " m_respons_status = " << tp_carrier_task->m_respons_status << std::endl;
-		std::cout << " huli test :::: " << " m_respons_x = " << tp_carrier_task->m_respons_x << std::endl;
-		std::cout << " huli test :::: " << " m_respons_y = " << tp_carrier_task->m_respons_y << std::endl;
-		std::cout << " huli test :::: " << " m_respons_z = " << tp_carrier_task->m_respons_z << std::endl;
-		std::cout << " huli test :::: " << " m_respons_y1 = " << tp_carrier_task->m_respons_y1 << std::endl;
-		std::cout << " huli test :::: " << " m_respons_y2 = " << tp_carrier_task->m_respons_y2 << std::endl;
-		std::cout << " huli test :::: " << " m_respons_clamp_motion = " << tp_carrier_task->m_respons_clamp_motion << std::endl;
-		std::cout << " huli test :::: " << " m_respons_joint_motion_x = " << tp_carrier_task->m_respons_joint_motion_x << std::endl;
-		std::cout << " huli test :::: " << " m_respons_joint_motion_y = " << tp_carrier_task->m_respons_joint_motion_y << std::endl;
-		std::cout << " huli test :::: " << " m_respons_space_id = " << tp_carrier_task->m_respons_space_id << std::endl;
-		std::cout << " huli test :::: " << " m_respons_floor_id = " << tp_carrier_task->m_respons_floor_id << std::endl;
-		std::cout << " huli test :::: " << " m_respons_wheelbase = " << tp_carrier_task->m_respons_wheelbase << std::endl;
-		std::cout << " ---------------------------------------------------" << std::endl;
-
 
 
 
-
-		std::cout << " huli test :::: " << " *********************************************** = " << std::endl;
-		std::cout << " huli test :::: " << " t_carrier_base.get_carrier_status() = " << t_carrier.get_dispatch_device_status() << std::endl;
-		int heat = t_carrier.m_last_heartbeat;
-		std::cout << " huli test :::: " << " m_last_heartbeat = " << heat << std::endl;
-		std::cout << " huli test :::: " << " m_actual_device_status = " << t_carrier.m_actual_device_status << std::endl;
-		std::cout << " huli test :::: " << " m_actual_load_status = " << t_carrier.m_actual_load_status << std::endl;
-		std::cout << " huli test :::: " << " m_actual_x = " << t_carrier.m_actual_x << std::endl;
-		std::cout << " huli test :::: " << " m_actual_y = " << t_carrier.m_actual_y << std::endl;
-		std::cout << " huli test :::: " << " m_actual_z = " << t_carrier.m_actual_z << std::endl;
-		std::cout << " huli test :::: " << " m_actual_y1 = " << t_carrier.m_actual_y1 << std::endl;
-		std::cout << " huli test :::: " << " m_actual_y2 = " << t_carrier.m_actual_y2 << std::endl;
-		std::cout << " huli test :::: " << " m_actual_clamp_motion1 = " << t_carrier.m_actual_clamp_motion1 << std::endl;
-		std::cout << " huli test :::: " << " m_actual_clamp_motion2 = " << t_carrier.m_actual_clamp_motion2 << std::endl;
-		std::cout << " huli test :::: " << " m_actual_small_sports_car_motion = " << t_carrier.m_actual_small_sports_car_motion << std::endl;
-		std::cout << " huli test :::: " << " m_actual_joint_motion_x1 = " << t_carrier.m_actual_joint_motion_x1 << std::endl;
-		std::cout << " huli test :::: " << " m_actual_joint_motion_x2 = " << t_carrier.m_actual_joint_motion_x2 << std::endl;
-		std::cout << " huli test :::: " << " m_actual_error_code = " <<  std::endl;
-		for (int i = 0; i < 50; ++i)
-		{
-			printf("0x%x ", t_carrier.m_actual_error_code[i]);
-		}
-		std::cout <<  std::endl;
-
-		std::cout << " huli test :::: " << " m_actual_warning_code = " <<  std::endl;
-		for (int i = 0; i < 50; ++i)
-		{
-			printf("0x%x ", t_carrier.m_actual_warning_code[i]);
-		}
-		std::cout <<  std::endl;
-		std::cout << " huli test :::: " << " m_actual_error_description = " << t_carrier.m_actual_error_description << std::endl;
-
-		std::cout << " huli test :::: " << " *********************************************** = " << std::endl;
-
-
-
-		std::this_thread::sleep_for(std::chrono::milliseconds(1000));
-
-	}
-*/
-
-
 	Carrier t_carrier21;
 	t_error = t_carrier21.dispatch_device_base_init(1, 207);
 	std::cout << " huli test :::: " << " t_error = " << t_error << std::endl;
-	std::this_thread::sleep_for(std::chrono::seconds(2));
+	std::this_thread::sleep_for(std::chrono::milliseconds(2));
 
 	std::shared_ptr<Task_Base> tp_task_Base21(new Carrier_task);
 	Carrier_task * tp_carrier_task21 = (Carrier_task *)tp_task_Base21.get();
@@ -376,86 +236,18 @@ int main(int argc,char* argv[])
 	std::cout << " huli test :::: " << " t_error = " << t_error << std::endl;
 	std::cout << " ---------------------------------------------------" << std::endl;
 
-	/*
-	char zxczxcxzc21 ;
-	std::cin >> zxczxcxzc21 ;
-	while ( 1 )
-	{
-		std::cout << " huli test :::: " << "  ===================================== "   << std::endl;
-		std::cout << " huli test :::: " << " tp_carrier_task->get_task_statu = " << tp_carrier_task->get_task_statu() << std::endl;
-		std::cout << " huli test :::: " << " tp_carrier_task->m_respons_status = " << tp_carrier_task->m_respons_status << std::endl;
-
-
-		std::cout << " huli test :::: " << " m_respons_key = " << tp_carrier_task->m_respons_key << std::endl;
-		std::cout << " huli test :::: " << " m_respons_status = " << tp_carrier_task->m_respons_status << std::endl;
-		std::cout << " huli test :::: " << " m_respons_x = " << tp_carrier_task->m_respons_x << std::endl;
-		std::cout << " huli test :::: " << " m_respons_y = " << tp_carrier_task->m_respons_y << std::endl;
-		std::cout << " huli test :::: " << " m_respons_z = " << tp_carrier_task->m_respons_z << std::endl;
-		std::cout << " huli test :::: " << " m_respons_y1 = " << tp_carrier_task->m_respons_y1 << std::endl;
-		std::cout << " huli test :::: " << " m_respons_y2 = " << tp_carrier_task->m_respons_y2 << std::endl;
-		std::cout << " huli test :::: " << " m_respons_clamp_motion = " << tp_carrier_task->m_respons_clamp_motion << std::endl;
-		std::cout << " huli test :::: " << " m_respons_joint_motion_x = " << tp_carrier_task->m_respons_joint_motion_x << std::endl;
-		std::cout << " huli test :::: " << " m_respons_joint_motion_y = " << tp_carrier_task->m_respons_joint_motion_y << std::endl;
-		std::cout << " huli test :::: " << " m_respons_space_id = " << tp_carrier_task->m_respons_space_id << std::endl;
-		std::cout << " huli test :::: " << " m_respons_floor_id = " << tp_carrier_task->m_respons_floor_id << std::endl;
-		std::cout << " huli test :::: " << " m_respons_wheelbase = " << tp_carrier_task->m_respons_wheelbase << std::endl;
-		std::cout << " ---------------------------------------------------" << std::endl;
-
-
-
-
-
-		std::cout << " huli test :::: " << " *********************************************** = " << std::endl;
-		std::cout << " huli test :::: " << " t_carrier_base.get_carrier_status() = " << t_carrier.get_dispatch_device_status() << std::endl;
-		int heat = t_carrier.m_last_heartbeat;
-		std::cout << " huli test :::: " << " m_last_heartbeat = " << heat << std::endl;
-		std::cout << " huli test :::: " << " m_actual_device_status = " << t_carrier.m_actual_device_status << std::endl;
-		std::cout << " huli test :::: " << " m_actual_load_status = " << t_carrier.m_actual_load_status << std::endl;
-		std::cout << " huli test :::: " << " m_actual_x = " << t_carrier.m_actual_x << std::endl;
-		std::cout << " huli test :::: " << " m_actual_y = " << t_carrier.m_actual_y << std::endl;
-		std::cout << " huli test :::: " << " m_actual_z = " << t_carrier.m_actual_z << std::endl;
-		std::cout << " huli test :::: " << " m_actual_y1 = " << t_carrier.m_actual_y1 << std::endl;
-		std::cout << " huli test :::: " << " m_actual_y2 = " << t_carrier.m_actual_y2 << std::endl;
-		std::cout << " huli test :::: " << " m_actual_clamp_motion1 = " << t_carrier.m_actual_clamp_motion1 << std::endl;
-		std::cout << " huli test :::: " << " m_actual_clamp_motion2 = " << t_carrier.m_actual_clamp_motion2 << std::endl;
-		std::cout << " huli test :::: " << " m_actual_small_sports_car_motion = " << t_carrier.m_actual_small_sports_car_motion << std::endl;
-		std::cout << " huli test :::: " << " m_actual_joint_motion_x1 = " << t_carrier.m_actual_joint_motion_x1 << std::endl;
-		std::cout << " huli test :::: " << " m_actual_joint_motion_x2 = " << t_carrier.m_actual_joint_motion_x2 << std::endl;
-		std::cout << " huli test :::: " << " m_actual_error_code = " <<  std::endl;
-		for (int i = 0; i < 50; ++i)
-		{
-			printf("0x%x ", t_carrier.m_actual_error_code[i]);
-		}
-		std::cout <<  std::endl;
-
-		std::cout << " huli test :::: " << " m_actual_warning_code = " <<  std::endl;
-		for (int i = 0; i < 50; ++i)
-		{
-			printf("0x%x ", t_carrier.m_actual_warning_code[i]);
-		}
-		std::cout <<  std::endl;
-		std::cout << " huli test :::: " << " m_actual_error_description = " << t_carrier.m_actual_error_description << std::endl;
-
-		std::cout << " huli test :::: " << " *********************************************** = " << std::endl;
-
-
-
-		std::this_thread::sleep_for(std::chrono::milliseconds(1000));
-
-	}
-*/
 
 
 	Carrier t_carrier22;
 	t_error = t_carrier22.dispatch_device_base_init(2, 203);
 	std::cout << " huli test :::: " << " t_error = " << t_error << std::endl;
-	std::this_thread::sleep_for(std::chrono::seconds(2));
+	std::this_thread::sleep_for(std::chrono::milliseconds(2));
 
 	std::shared_ptr<Task_Base> tp_task_Base22(new Carrier_task);
 	Carrier_task * tp_carrier_task22 = (Carrier_task *)tp_task_Base22.get();
 	tp_carrier_task22->task_init(NULL,std::chrono::milliseconds(15000));
 	tp_carrier_task22->m_request_key = "x23456789012345678901234567890c2";
-	tp_carrier_task22->m_request_x = 17955;
+	tp_carrier_task22->m_request_x = 7755;
 //	tp_carrier_task22->m_request_x = 4700;
 	tp_carrier_task22->m_request_y = 3000;
 	tp_carrier_task22->m_request_z = 5125;
@@ -472,82 +264,13 @@ int main(int argc,char* argv[])
 	std::cout << " huli test :::: " << " t_error = " << t_error << std::endl;
 	std::cout << " ---------------------------------------------------" << std::endl;
 
-	/*
-	char zxczxcxzc22 ;
-	std::cin >> zxczxcxzc22 ;
-	while ( 1 )
-	{
-		std::cout << " huli test :::: " << "  ===================================== "   << std::endl;
-		std::cout << " huli test :::: " << " tp_carrier_task->get_task_statu = " << tp_carrier_task->get_task_statu() << std::endl;
-		std::cout << " huli test :::: " << " tp_carrier_task->m_respons_status = " << tp_carrier_task->m_respons_status << std::endl;
-
-
-		std::cout << " huli test :::: " << " m_respons_key = " << tp_carrier_task->m_respons_key << std::endl;
-		std::cout << " huli test :::: " << " m_respons_status = " << tp_carrier_task->m_respons_status << std::endl;
-		std::cout << " huli test :::: " << " m_respons_x = " << tp_carrier_task->m_respons_x << std::endl;
-		std::cout << " huli test :::: " << " m_respons_y = " << tp_carrier_task->m_respons_y << std::endl;
-		std::cout << " huli test :::: " << " m_respons_z = " << tp_carrier_task->m_respons_z << std::endl;
-		std::cout << " huli test :::: " << " m_respons_y1 = " << tp_carrier_task->m_respons_y1 << std::endl;
-		std::cout << " huli test :::: " << " m_respons_y2 = " << tp_carrier_task->m_respons_y2 << std::endl;
-		std::cout << " huli test :::: " << " m_respons_clamp_motion = " << tp_carrier_task->m_respons_clamp_motion << std::endl;
-		std::cout << " huli test :::: " << " m_respons_joint_motion_x = " << tp_carrier_task->m_respons_joint_motion_x << std::endl;
-		std::cout << " huli test :::: " << " m_respons_joint_motion_y = " << tp_carrier_task->m_respons_joint_motion_y << std::endl;
-		std::cout << " huli test :::: " << " m_respons_space_id = " << tp_carrier_task->m_respons_space_id << std::endl;
-		std::cout << " huli test :::: " << " m_respons_floor_id = " << tp_carrier_task->m_respons_floor_id << std::endl;
-		std::cout << " huli test :::: " << " m_respons_wheelbase = " << tp_carrier_task->m_respons_wheelbase << std::endl;
-		std::cout << " ---------------------------------------------------" << std::endl;
-
-
-
-
-
-		std::cout << " huli test :::: " << " *********************************************** = " << std::endl;
-		std::cout << " huli test :::: " << " t_carrier_base.get_carrier_status() = " << t_carrier.get_dispatch_device_status() << std::endl;
-		int heat = t_carrier.m_last_heartbeat;
-		std::cout << " huli test :::: " << " m_last_heartbeat = " << heat << std::endl;
-		std::cout << " huli test :::: " << " m_actual_device_status = " << t_carrier.m_actual_device_status << std::endl;
-		std::cout << " huli test :::: " << " m_actual_load_status = " << t_carrier.m_actual_load_status << std::endl;
-		std::cout << " huli test :::: " << " m_actual_x = " << t_carrier.m_actual_x << std::endl;
-		std::cout << " huli test :::: " << " m_actual_y = " << t_carrier.m_actual_y << std::endl;
-		std::cout << " huli test :::: " << " m_actual_z = " << t_carrier.m_actual_z << std::endl;
-		std::cout << " huli test :::: " << " m_actual_y1 = " << t_carrier.m_actual_y1 << std::endl;
-		std::cout << " huli test :::: " << " m_actual_y2 = " << t_carrier.m_actual_y2 << std::endl;
-		std::cout << " huli test :::: " << " m_actual_clamp_motion1 = " << t_carrier.m_actual_clamp_motion1 << std::endl;
-		std::cout << " huli test :::: " << " m_actual_clamp_motion2 = " << t_carrier.m_actual_clamp_motion2 << std::endl;
-		std::cout << " huli test :::: " << " m_actual_small_sports_car_motion = " << t_carrier.m_actual_small_sports_car_motion << std::endl;
-		std::cout << " huli test :::: " << " m_actual_joint_motion_x1 = " << t_carrier.m_actual_joint_motion_x1 << std::endl;
-		std::cout << " huli test :::: " << " m_actual_joint_motion_x2 = " << t_carrier.m_actual_joint_motion_x2 << std::endl;
-		std::cout << " huli test :::: " << " m_actual_error_code = " <<  std::endl;
-		for (int i = 0; i < 50; ++i)
-		{
-			printf("0x%x ", t_carrier.m_actual_error_code[i]);
-		}
-		std::cout <<  std::endl;
-
-		std::cout << " huli test :::: " << " m_actual_warning_code = " <<  std::endl;
-		for (int i = 0; i < 50; ++i)
-		{
-			printf("0x%x ", t_carrier.m_actual_warning_code[i]);
-		}
-		std::cout <<  std::endl;
-		std::cout << " huli test :::: " << " m_actual_error_description = " << t_carrier.m_actual_error_description << std::endl;
-
-		std::cout << " huli test :::: " << " *********************************************** = " << std::endl;
-
-
-
-		std::this_thread::sleep_for(std::chrono::milliseconds(1000));
-
-	}
-*/
-
 
 /*
 
 	Passageway t_passageway;
 	t_error = t_passageway.dispatch_device_base_init(1);
 	std::cout << " huli test :::: " << " t_error = " << t_error << std::endl;
-	std::this_thread::sleep_for(std::chrono::seconds(2));
+	std::this_thread::sleep_for(std::chrono::milliseconds(2));
 
 	std::shared_ptr<Task_Base> tp_task_Base3(new Passageway_task);
 	Passageway_task * tp_passageway_task = (Passageway_task *)tp_task_Base3.get();