瀏覽代碼

20210521, 调度流程修改

huli 4 年之前
父節點
當前提交
77f3dcee15

+ 4 - 1
dispatch/carrier_task.h

@@ -8,6 +8,7 @@
 #include "../error_code/error_code.h"
 #include "../error_code/error_code.h"
 #include "../task/task_command_manager.h"
 #include "../task/task_command_manager.h"
 #include "../task/task_base.h"
 #include "../task/task_base.h"
+#include "../tool/common_data.h"
 #include <mutex>
 #include <mutex>
 
 
 
 
@@ -52,8 +53,10 @@ public://member variable
 
 
 	std::mutex							m_lock;	//锁
 	std::mutex							m_lock;	//锁
 	int 								m_step;//长流程细分为短流程, m_step 控制短流程的步骤
 	int 								m_step;//长流程细分为短流程, m_step 控制短流程的步骤
+	Common_data::Dispatch_process_type		m_dispatch_process_type;	//调度任务类型
 
 
-//调度下发到plc
+
+	//调度下发到plc
 	std::string							m_request_key;				//请求唯一码, 用作识别
 	std::string							m_request_key;				//请求唯一码, 用作识别
 	//请求的目标坐标和动作
 	//请求的目标坐标和动作
 	float 								m_request_x;				//搬运器坐标x轴, 中跑车控制横向移动
 	float 								m_request_x;				//搬运器坐标x轴, 中跑车控制横向移动

+ 2 - 1
dispatch/catcher_task.h

@@ -9,7 +9,7 @@
 #include "../task/task_command_manager.h"
 #include "../task/task_command_manager.h"
 #include "../task/task_base.h"
 #include "../task/task_base.h"
 #include <mutex>
 #include <mutex>
-
+#include "../tool/common_data.h"
 
 
 class Catcher_task:public Task_Base
 class Catcher_task:public Task_Base
 {
 {
@@ -48,6 +48,7 @@ protected://member variable
 public:
 public:
 	std::mutex							m_lock;	//锁
 	std::mutex							m_lock;	//锁
 	int 								m_step;//长流程细分为短流程, m_step 控制短流程的步骤
 	int 								m_step;//长流程细分为短流程, m_step 控制短流程的步骤
+	Common_data::Dispatch_process_type		m_dispatch_process_type;	//调度任务类型
 
 
 	//调度下发到plc
 	//调度下发到plc
 	std::string							m_request_key;				//请求唯一码, 用作识别
 	std::string							m_request_key;				//请求唯一码, 用作识别

+ 87 - 6
dispatch/dispatch_device_base.cpp

@@ -276,12 +276,6 @@ Error_manager Dispatch_device_base::check_status()
 	return Error_code::SUCCESS;
 	return Error_code::SUCCESS;
 }
 }
 
 
-//判断是否为待机,如果已经准备好,则可以执行任务。
-bool Dispatch_device_base::is_ready()
-{
-	return (m_dispatch_device_status == DISPATCH_DEVICE_READY);
-}
-
 
 
 //结束任务单,里面会根据任务的故障等级修正 任务单的状态
 //结束任务单,里面会根据任务的故障等级修正 任务单的状态
 Error_manager Dispatch_device_base::end_task(std::shared_ptr<Task_Base> p_task)
 Error_manager Dispatch_device_base::end_task(std::shared_ptr<Task_Base> p_task)
@@ -338,6 +332,93 @@ Error_manager Dispatch_device_base::cancel_task(std::shared_ptr<Task_Base> p_tas
 	return Error_code::SUCCESS;
 	return Error_code::SUCCESS;
 }
 }
 
 
+//判断是否为待机,如果已经准备好,则可以执行任务。
+bool Dispatch_device_base::is_ready()
+{
+	std::unique_lock<std::mutex> t_lock(m_lock);
+	if ( m_dispatch_device_status == DISPATCH_DEVICE_READY &&
+		 m_device_one_level_command_key == "" &&
+		 m_device_two_level_command_key == "" &&
+		 m_device_three_level_command_key == "" )
+	{
+		return true;
+	}
+	else
+	{
+		return false;
+	}
+}
+//判断是否可以执行存车任务。
+bool Dispatch_device_base::is_able_excute_store()
+{
+	std::unique_lock<std::mutex> t_lock(m_lock);
+	if ( m_device_one_level_command_key == "" )
+	{
+		if ( m_dispatch_device_status == DISPATCH_DEVICE_READY ||
+			 m_dispatch_device_status == DISPATCH_DEVICE_TWO_LEVEL_OVER ||
+			 m_dispatch_device_status == DISPATCH_DEVICE_TWO_LEVEL_WORK)
+		{
+			return true;
+		}
+		else if ( m_dispatch_device_status == DISPATCH_DEVICE_THREE_LEVEL_OVER ||
+				  m_dispatch_device_status == DISPATCH_DEVICE_THREE_LEVEL_WORK )
+		{
+			if ( m_device_three_level_process_type == Common_data::Dispatch_process_type::DISPATCH_PROCESS_PICKUP )
+			{
+			    return true;
+			}
+			else
+			{
+			    return false;
+			}
+		}
+		else
+		{
+			return false;
+		}
+	}
+	else
+	{
+	    return false;
+	}
+
+}
+//判断是否可以执行取车任务。
+bool Dispatch_device_base::is_able_excute_pickup()
+{
+	std::unique_lock<std::mutex> t_lock(m_lock);
+	if ( m_device_one_level_command_key == "" )
+	{
+		if ( m_dispatch_device_status == DISPATCH_DEVICE_READY ||
+			 m_dispatch_device_status == DISPATCH_DEVICE_TWO_LEVEL_OVER ||
+			 m_dispatch_device_status == DISPATCH_DEVICE_TWO_LEVEL_WORK)
+		{
+			return true;
+		}
+		else if ( m_dispatch_device_status == DISPATCH_DEVICE_THREE_LEVEL_OVER ||
+				  m_dispatch_device_status == DISPATCH_DEVICE_THREE_LEVEL_WORK )
+		{
+			if ( m_device_three_level_process_type == Common_data::Dispatch_process_type::DISPATCH_PROCESS_STORE )
+			{
+				return true;
+			}
+			else
+			{
+				return false;
+			}
+		}
+		else
+		{
+			return false;
+		}
+	}
+	else
+	{
+		return false;
+	}
+}
+
+
 Dispatch_device_base::Dispatch_device_status Dispatch_device_base::get_dispatch_device_status()
 Dispatch_device_base::Dispatch_device_status Dispatch_device_base::get_dispatch_device_status()
 {
 {
 	return m_dispatch_device_status;
 	return m_dispatch_device_status;

+ 16 - 3
dispatch/dispatch_device_base.h

@@ -189,14 +189,19 @@ public://API functions
 
 
 	//检查状态,是否正常运行. (工作状态 和 是否能接受对应的任务无关)
 	//检查状态,是否正常运行. (工作状态 和 是否能接受对应的任务无关)
 	virtual Error_manager check_status();
 	virtual Error_manager check_status();
-	//判断是否为待机,如果已经准备好,则可以执行任务。
-	virtual bool is_ready();
+
 
 
 	//结束任务单,里面会根据任务的故障等级修正 任务单的状态
 	//结束任务单,里面会根据任务的故障等级修正 任务单的状态
 	virtual Error_manager end_task(std::shared_ptr<Task_Base> p_task);
 	virtual Error_manager end_task(std::shared_ptr<Task_Base> p_task);
 	//取消任务单,由发送方提前取消任务单
 	//取消任务单,由发送方提前取消任务单
 	virtual Error_manager cancel_task(std::shared_ptr<Task_Base> p_task, Dispatch_task_level dispatch_task_level);
 	virtual Error_manager cancel_task(std::shared_ptr<Task_Base> p_task, Dispatch_task_level dispatch_task_level);
 
 
+	//判断是否为待机,如果已经准备好,则可以执行任务。
+	virtual bool is_ready();
+	//判断是否可以执行存车任务。
+	virtual bool is_able_excute_store();
+	//判断是否可以执行取车任务。
+	virtual bool is_able_excute_pickup();
 
 
 public://get or set member variable
 public://get or set member variable
 	Dispatch_device_status get_dispatch_device_status();
 	Dispatch_device_status get_dispatch_device_status();
@@ -241,9 +246,17 @@ protected://member variable
 	std::thread*        				mp_execute_thread;   			//执行的线程指针,内存由本类管理
 	std::thread*        				mp_execute_thread;   			//执行的线程指针,内存由本类管理
 	Thread_condition					m_execute_condition;			//执行的条件变量
 	Thread_condition					m_execute_condition;			//执行的条件变量
 
 
-	std::string							m_command_key_one_level;		//设备任务的唯一码, (用作任务预约)
+
+	std::string							m_device_one_level_command_key;		//设备任务的唯一码, (用作任务预约)
+	Common_data::Dispatch_process_type	m_device_one_level_process_type;	//调度任务类型
 	std::shared_ptr<Task_Base>			mp_device_one_level_task;		//设备的普通任务, (一般移动和等待指令, 允许被打断)
 	std::shared_ptr<Task_Base>			mp_device_one_level_task;		//设备的普通任务, (一般移动和等待指令, 允许被打断)
+
+	std::string							m_device_two_level_command_key;		//设备任务的唯一码, (用作任务预约)
+	Common_data::Dispatch_process_type	m_device_two_level_process_type;	//调度任务类型
 	std::shared_ptr<Task_Base>			mp_device_two_level_task;		//设备的优先任务, (紧急避让和插队指令, 允许打断普通任务)
 	std::shared_ptr<Task_Base>			mp_device_two_level_task;		//设备的优先任务, (紧急避让和插队指令, 允许打断普通任务)
+
+	std::string							m_device_three_level_command_key;		//设备任务的唯一码, (用作任务预约)
+	Common_data::Dispatch_process_type	m_device_three_level_process_type;	//调度任务类型
 	std::shared_ptr<Task_Base>			mp_device_three_level_task;		//设备的核心任务, (锁定位置进行抓车和放车, 最高任务, 不允许打断和被打断)
 	std::shared_ptr<Task_Base>			mp_device_three_level_task;		//设备的核心任务, (锁定位置进行抓车和放车, 最高任务, 不允许打断和被打断)
 	//task任务的流程由Dispatch_process来管理
 	//task任务的流程由Dispatch_process来管理
 
 

+ 44 - 2
dispatch/dispatch_manager.cpp

@@ -108,6 +108,9 @@ Error_manager Dispatch_manager::dispatch_manager_init_from_protobuf(Dispatch_pro
 		m_process_thread_queue->Start(48);
 		m_process_thread_queue->Start(48);
 	}
 	}
 
 
+	//	线程默认开启
+	m_dispatch_manager_condition.reset(false, true, false);
+	m_dispatch_manager_thread = new std::thread(&Dispatch_manager::resource_allocation, this);
 
 
 	m_dispatch_manager_status = E_DISPATCH_MANAGER_READY;
 	m_dispatch_manager_status = E_DISPATCH_MANAGER_READY;
 	return Error_code::SUCCESS;
 	return Error_code::SUCCESS;
@@ -279,7 +282,7 @@ Error_manager Dispatch_manager::execute_for_dispatch_request_msg(message::Dispat
 		std::unique_lock<std::mutex> t_lock(m_lock);
 		std::unique_lock<std::mutex> t_lock(m_lock);
 		//流程缓存到map
 		//流程缓存到map
 		if (tp_dispatch_process->m_dispatch_process_type ==
 		if (tp_dispatch_process->m_dispatch_process_type ==
-			Dispatch_process::Dispatch_process_type::DISPATCH_PROCESS_STORE)
+		Common_data::Dispatch_process_type::DISPATCH_PROCESS_STORE)
 		{
 		{
 			m_process_store_list.push_back(tp_dispatch_process);
 			m_process_store_list.push_back(tp_dispatch_process);
 			//这里就不查重了, 需要主控保证不会重复发送...
 			//这里就不查重了, 需要主控保证不会重复发送...
@@ -296,7 +299,7 @@ Error_manager Dispatch_manager::execute_for_dispatch_request_msg(message::Dispat
 //			}
 //			}
 		}
 		}
 		else if (tp_dispatch_process->m_dispatch_process_type ==
 		else if (tp_dispatch_process->m_dispatch_process_type ==
-				 Dispatch_process::Dispatch_process_type::DISPATCH_PROCESS_PICKUP)
+		Common_data::Dispatch_process_type::DISPATCH_PROCESS_PICKUP)
 		{
 		{
 			m_process_pickup_list.push_back(tp_dispatch_process);
 			m_process_pickup_list.push_back(tp_dispatch_process);
 			//这里就不查重了, 需要主控保证不会重复发送...
 			//这里就不查重了, 需要主控保证不会重复发送...
@@ -639,3 +642,42 @@ void Dispatch_manager::set_dispatch_manager_id(int dispatch_manager_id)
 {
 {
 	m_dispatch_manager_id = dispatch_manager_id;
 	m_dispatch_manager_id = dispatch_manager_id;
 }
 }
+
+
+//资源分配
+void Dispatch_manager::resource_allocation()
+{
+	LOG(INFO) << " Dispatch_manager::resource_allocation() start " << this;
+	Error_manager t_error;
+
+	while (m_dispatch_manager_condition.is_alive())
+	{
+		m_dispatch_manager_condition.wait();
+		if ( m_dispatch_manager_condition.is_alive() )
+		{
+			std::this_thread::sleep_for(std::chrono::microseconds(1));
+//			std::this_thread::sleep_for(std::chrono::milliseconds(1));
+//			std::this_thread::sleep_for(std::chrono::seconds(1));
+			std::this_thread::yield();
+			std::unique_lock<std::mutex> t_lock(m_lock);
+
+			//本线程函数只负责分配搬运器的资源 给对应的流程
+			//然后拥有搬运器资源的流程, 自己去抢机器人的资源.
+			//注意了: 搬运器有3个, 需要合理安排路线, 尽量保证搬运器以存取存取的顺序执行任务, 搬运器最好不要空载运行.
+			//注意了: 机器人只有1个, 是调度系统最紧缺的资源, 尽量保证机器人无间断一直运行, 使效率最大化.
+
+
+			//优先做取车
+			for (auto iter = m_process_pickup_list.begin(); iter != m_process_pickup_list.end(); ++iter)
+			{
+
+			}
+
+
+
+		}
+	}
+
+	LOG(INFO) << " Dispatch_manager::resource_allocation() end "<< this;
+	return;
+}

+ 3 - 0
dispatch/dispatch_manager.h

@@ -126,6 +126,9 @@ public://get or set member variable
 	int get_dispatch_manager_id();
 	int get_dispatch_manager_id();
 	void set_dispatch_manager_id(int dispatch_id);
 	void set_dispatch_manager_id(int dispatch_id);
 
 
+protected:
+	//资源分配
+	void resource_allocation();
 
 
 
 
 public://member variable
 public://member variable

+ 7 - 5
dispatch/dispatch_process.cpp

@@ -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;
 }
 }
 
 

+ 7 - 12
dispatch/dispatch_process.h

@@ -44,7 +44,7 @@ class Dispatch_process : public tq::BaseTask
 public:
 public:
 	//调度指令超时时间 300000ms = 5min
 	//调度指令超时时间 300000ms = 5min
 #define DISPATCH_PROCESS_TIMEOUT_MS							600000
 #define DISPATCH_PROCESS_TIMEOUT_MS							600000
-//调度指令超时时间  衰减值 在原有的基础上减少30秒
+//调度指令超时时间  衰减值 在原有的基础上减少10秒
 #define DISPATCH_PROCESS_ATTENUATION_TIMEOUT_MS				10000
 #define DISPATCH_PROCESS_ATTENUATION_TIMEOUT_MS				10000
 
 
 //调度默认 差值 2mm (比较结果, 对精度要求较高)
 //调度默认 差值 2mm (比较结果, 对精度要求较高)
@@ -68,13 +68,7 @@ public:
 		DISPATCH_PROCESS_FAULT					= 10,	//故障
 		DISPATCH_PROCESS_FAULT					= 10,	//故障
 		DISPATCH_PROCESS_MOTION_FAILED			= 11,	//单个小动作执行失败
 		DISPATCH_PROCESS_MOTION_FAILED			= 11,	//单个小动作执行失败
 	};
 	};
-	//调度任务类型
-	enum Dispatch_process_type
-	{
-		DISPATCH_PROCESS_TYPE_UNKNOW 			= 0,    //未知
-		DISPATCH_PROCESS_STORE  				= 101,    //存车
-		DISPATCH_PROCESS_PICKUP					= 102,	//取车
-	};
+
 
 
 
 
 
 
@@ -125,7 +119,7 @@ public:
 		//目前没有让别人避让的功能
 		//目前没有让别人避让的功能
 	};
 	};
 
 
-	//调度设备机器人节点
+	//调度设备搬运器节点
 	struct Dispatch_carrier_node
 	struct Dispatch_carrier_node
 	{
 	{
 		Dispatch_control_status					m_dispatch_control_status;			//调度控制的状态, 控制步骤(对于一个设备的长流程的控制)
 		Dispatch_control_status					m_dispatch_control_status;			//调度控制的状态, 控制步骤(对于一个设备的长流程的控制)
@@ -261,7 +255,7 @@ public://member variable
 
 
 	//流程总规划数据, 外部指令
 	//流程总规划数据, 外部指令
 	std::mutex                          	m_lock;
 	std::mutex                          	m_lock;
-	Dispatch_process_type					m_dispatch_process_type;	//调度任务类型
+	Common_data::Dispatch_process_type		m_dispatch_process_type;	//调度任务类型
 	int 									m_dispatch_source;			//调度的起点,源头 (Dispatch_plan 总计划的起点)
 	int 									m_dispatch_source;			//调度的起点,源头 (Dispatch_plan 总计划的起点)
 	int 									m_dispatch_destination;		//调度的终点,目的地(Dispatch_plan 总计划的终点)
 	int 									m_dispatch_destination;		//调度的终点,目的地(Dispatch_plan 总计划的终点)
 	Common_data::Car_measure_information	m_car_measure_information;	//整车的测量信息
 	Common_data::Car_measure_information	m_car_measure_information;	//整车的测量信息
@@ -274,8 +268,9 @@ public://member variable
 	float 									m_wheel_base;						//轮距
 	float 									m_wheel_base;						//轮距
 
 
 
 
-	//调度控制的节点
-
+	//调度设备控制节点, 核心设备由调度管理进行资源分配, 本流程模块只负责使用
+	Dispatch_catcher_node					m_dispatch_catcher_node;			//调度设备机器人节点
+	Dispatch_carrier_node					m_dispatch_carrier_node;			//调度设备搬运器节点
 
 
 
 
 
 

+ 1 - 1
dispatch/passageway.h

@@ -7,7 +7,7 @@
 
 
 #include "../dispatch/passageway_task.h"
 #include "../dispatch/passageway_task.h"
 #include "../dispatch/dispatch_device_base.h"
 #include "../dispatch/dispatch_device_base.h"
-
+#include "../tool/common_data.h"
 //一楼的出入口,通道口
 //一楼的出入口,通道口
 class Passageway:public Dispatch_device_base
 class Passageway:public Dispatch_device_base
 {
 {

+ 2 - 0
dispatch/passageway_task.h

@@ -9,6 +9,7 @@
 #include "../task/task_command_manager.h"
 #include "../task/task_command_manager.h"
 #include "../task/task_base.h"
 #include "../task/task_base.h"
 #include <mutex>
 #include <mutex>
+#include "../tool/common_data.h"
 
 
 class Passageway_task:public Task_Base
 class Passageway_task:public Task_Base
 {
 {
@@ -53,6 +54,7 @@ public://member variable
 
 
 	std::mutex							m_lock;	//锁
 	std::mutex							m_lock;	//锁
 	int 								m_step;//长流程细分为短流程, m_step 控制短流程的步骤
 	int 								m_step;//长流程细分为短流程, m_step 控制短流程的步骤
+	Common_data::Dispatch_process_type		m_dispatch_process_type;	//调度任务类型
 
 
 	//调度下发到plc
 	//调度下发到plc
 	std::string							m_request_key;				//请求唯一码, 用作识别
 	std::string							m_request_key;				//请求唯一码, 用作识别

+ 16 - 0
tool/common_data.h

@@ -149,6 +149,22 @@ public:
 	static bool approximate_rate(float a, float b, float rate);
 	static bool approximate_rate(float a, float b, float rate);
 	static bool approximate_difference(float a, float b, float difference);
 	static bool approximate_difference(float a, float b, float difference);
 
 
+
+
+
+
+
+
+
+
+	//调度模块
+	//调度任务类型
+	enum Dispatch_process_type
+	{
+		DISPATCH_PROCESS_TYPE_UNKNOW 			= 0,    //未知
+		DISPATCH_PROCESS_STORE  				= 101,    //存车
+		DISPATCH_PROCESS_PICKUP					= 102,	//取车
+	};
 };
 };