Ver Fonte

20210316, 完成所有调度设备和plc的通信B

huli há 4 anos atrás
pai
commit
ad1ce3edc5

+ 337 - 0
dispatch/passageway.cpp

@@ -0,0 +1,337 @@
+//
+// Created by huli on 2021/3/16.
+//
+
+#include "passageway.h"
+
+
+Passageway::Passageway()
+{
+	m_request_inside_door_motion = DOOR_UNKNOWN;
+	m_request_outside_door_motion = DOOR_UNKNOWN;
+	m_request_turntable_direction = TURNTABLE_DIRECTION_UNKNOWN;
+
+	m_respons_status = RESPONS_WORKING;			//指令完成状态, 搬运器答复指令, 返回任务完成的情况
+	m_respons_inside_door_motion = DOOR_UNKNOWN;
+	m_respons_outside_door_motion = DOOR_UNKNOWN;
+	m_respons_turntable_direction = TURNTABLE_DIRECTION_UNKNOWN;
+
+	m_status_updata_time = std::chrono::system_clock::now();
+	m_last_heartbeat = 0;			//上一次的心跳
+	m_actual_device_status = DEVICE_UNKNOWN;			//通道口的硬件设备状态
+	m_actual_inside_load_status = LOAD_UNKNOWN;	//通道口的内部负载状态, 门内地感是否有车.
+	m_actual_outside_load_status = LOAD_UNKNOWN;	//通道口的外部负载状态, 门外地感是否有车.
+	m_actual_front_overstep_the_boundary = BOUNDARY_NORMAL;	//通道口 汽车前边界
+	m_actual_back_overstep_the_boundary = BOUNDARY_NORMAL;	//通道口 汽车前边界
+	m_actual_height_overstep_the_boundary = BOUNDARY_NORMAL;	//通道口 车辆是否超高
+	m_actual_outside_door_sensor = LOAD_UNKNOWN;	//通道口 的外门处的传感器, 判断是否有车经过外门
+	//通道口的真实状态, 可能是路径中间的坐标
+	m_actual_inside_door_motion = DOOR_UNKNOWN;	//通道口 内门动作
+	m_actual_outside_door_motion = DOOR_UNKNOWN;	//通道口 外门动作
+	m_actual_turntable_load_status = LOAD_UNKNOWN;	//通道口 转盘负载状态, 是否有车.
+	m_actual_turntable_direction = TURNTABLE_DIRECTION_UNKNOWN;	//通道口 转台方向
+
+	memset(m_actual_error_code, 0, 50);	//搬运器设备的报警信息位
+	memset(m_actual_warning_code, 0, 50);	//升降机设备的报警信息位
+}
+
+Passageway::~Passageway()
+{
+
+}
+
+//检查任务类型, 子类必须重载, 用来检查输入的任务是否为子类所需的.
+Error_manager Passageway::check_task_type(std::shared_ptr<Task_Base> p_task)
+{
+	//检查任务类型,
+	if (p_task->get_task_type() != PASSAGEWAY_TASK)
+	{
+		return Error_manager(Error_code::PASSAGEWAY_TASK_TYPE_ERROR, Error_level::MINOR_ERROR,
+							 "Passageway::check_task_type  get_task_type() != PASSAGEWAY_TASK ");
+	}
+
+	return Error_code::SUCCESS;
+}
+
+//获取硬件设备的状态, 必须子类继承
+Passageway::Device_status Passageway::get_actual_device_status()
+{
+	return m_actual_device_status;
+}
+
+
+//把任务单写入到内存中, 子类必须重载
+Error_manager Passageway::write_task_to_memory(std::shared_ptr<Task_Base> p_task)
+{
+	//检查任务类型,
+	if (p_task->get_task_type() != PASSAGEWAY_TASK)
+	{
+		return Error_manager(Error_code::PASSAGEWAY_TASK_TYPE_ERROR, Error_level::MINOR_ERROR,
+							 "Passageway::check_task_type  get_task_type() != PASSAGEWAY_TASK ");
+	}
+	else
+	{
+		std::unique_lock<std::mutex> t_lock(m_lock);
+
+		Passageway_task* tp_passageway_task = (Passageway_task*)p_task.get();
+		std::unique_lock<std::mutex> t_lock1(tp_passageway_task->m_lock);
+		m_request_key = tp_passageway_task->m_request_key;
+		m_request_inside_door_motion = (Dispatch_device_base::Door_motion)tp_passageway_task->m_request_inside_door_motion;
+		m_request_outside_door_motion = (Dispatch_device_base::Door_motion)tp_passageway_task->m_request_outside_door_motion;
+		m_request_turntable_direction = (Dispatch_device_base::Turntable_direction)tp_passageway_task->m_request_turntable_direction;
+
+		return Error_code::SUCCESS;
+	}
+	return Error_code::SUCCESS;
+}
+//更新设备底层通信数据, 子类必须重载
+Error_manager Passageway::update_device_communication()
+{
+	std::unique_lock<std::mutex> t_lock1(Dispatch_communication::get_instance_references().m_data_lock);
+	std::unique_lock<std::mutex> t_lock(m_lock);
+
+	//请求消息, 调度->plc
+	Dispatch_communication::Passageway_request_from_dispatch_to_plc_for_data * tp_passageway_request_from_dispatch_to_plc_for_data =
+	& Dispatch_communication::get_instance_references().m_passageway_request_from_dispatch_to_plc_for_data[m_device_id];
+	Dispatch_communication::Passageway_request_from_dispatch_to_plc_for_key * tp_passageway_request_from_dispatch_to_plc_for_key =
+	& Dispatch_communication::get_instance_references().m_passageway_request_from_dispatch_to_plc_for_key[m_device_id];
+	memset(tp_passageway_request_from_dispatch_to_plc_for_key->m_request_key, 0, 50);
+	memcpy(tp_passageway_request_from_dispatch_to_plc_for_key->m_request_key, m_request_key.c_str(), m_request_key.size());
+	tp_passageway_request_from_dispatch_to_plc_for_data->m_request_inside_door_motion = m_request_inside_door_motion;
+	tp_passageway_request_from_dispatch_to_plc_for_data->m_request_outside_door_motion = m_request_outside_door_motion;
+	tp_passageway_request_from_dispatch_to_plc_for_data->m_request_turntable_direction = m_request_turntable_direction;
+
+
+
+	//答复消息, plc->调度
+	Dispatch_communication::Passageway_response_from_plc_to_dispatch * tp_passageway_response_from_plc_to_dispatch =
+	& Dispatch_communication::get_instance_references().m_passageway_response_from_plc_to_dispatch[m_device_id];
+	m_respons_key = (char*) tp_passageway_response_from_plc_to_dispatch->m_respons_key;
+	m_respons_status = (Dispatch_device_base::Respons_status)tp_passageway_response_from_plc_to_dispatch->m_respons_status;
+	m_respons_inside_door_motion = (Dispatch_device_base::Door_motion)tp_passageway_response_from_plc_to_dispatch->m_respons_inside_door_motion;
+	m_respons_outside_door_motion = (Dispatch_device_base::Door_motion)tp_passageway_response_from_plc_to_dispatch->m_respons_outside_door_motion;
+	m_respons_turntable_direction = (Dispatch_device_base::Turntable_direction)tp_passageway_response_from_plc_to_dispatch->m_respons_turntable_direction;
+
+
+	//状态消息, plc->调度
+	Dispatch_communication::Passageway_status_from_plc_to_dispatch *tp_passageway_status_from_plc_to_dispatch =
+	& Dispatch_communication::get_instance_references().m_passageway_status_from_plc_to_dispatch[m_device_id];
+	//通过心跳帧来判断通信是否正常
+	if ( m_last_heartbeat != tp_passageway_status_from_plc_to_dispatch->m_heartbeat )
+	{
+		m_last_heartbeat = tp_passageway_status_from_plc_to_dispatch->m_heartbeat;
+		m_status_updata_time = std::chrono::system_clock::now();
+
+		//设备异常  //注注注注注注注注意了, ==的优先级比&要高.
+		if ( (tp_passageway_status_from_plc_to_dispatch->m_safe_status & 0x02) == 0 )
+		{
+			m_actual_device_status = Dispatch_device_base::DEVICE_EMERGENCY_STOP;
+			m_dispatch_device_status = Dispatch_device_base::E_FAULT;
+		}
+		else if ( (tp_passageway_status_from_plc_to_dispatch->m_safe_status & 0x01) == 0 )
+		{
+			m_actual_device_status = Dispatch_device_base::DEVICE_FAULT;
+			m_dispatch_device_status = Dispatch_device_base::E_FAULT;
+		}
+		else//正常状态
+		{
+			if ( (tp_passageway_status_from_plc_to_dispatch->m_sensor_status2 & 0x20)== 1)
+			{
+				m_actual_device_status = Dispatch_device_base::DEVICE_WORKING;
+			}
+			else if( (tp_passageway_status_from_plc_to_dispatch->m_sensor_status2 & 0x20)== 0)
+			{
+				m_actual_device_status = Dispatch_device_base::DEVICE_READY;
+			}
+			else
+			{
+				m_actual_device_status = Dispatch_device_base::DEVICE_UNKNOWN;
+			}
+
+
+			//故障恢复之后   E_FAULT  ->>  E_THREE_LEVEL_WORK
+			if ( m_dispatch_device_status == Dispatch_device_base::E_FAULT )
+			{
+				m_dispatch_device_status = Dispatch_device_base::E_THREE_LEVEL_WORK;
+			}
+			//else 流程状态维持不变
+		}
+
+		//数据解析
+		if ( (tp_passageway_status_from_plc_to_dispatch->m_sensor_status1 & 0x01)== 1)
+		{
+			m_actual_inside_load_status = Dispatch_device_base::HAVE_CAR;
+		}
+		else
+		{
+			m_actual_inside_load_status = Dispatch_device_base::NO_CAR;
+		}
+		if ( (tp_passageway_status_from_plc_to_dispatch->m_sensor_status1 & 0x02)== 1)
+		{
+			m_actual_outside_load_status = Dispatch_device_base::HAVE_CAR;
+		}
+		else
+		{
+			m_actual_outside_load_status = Dispatch_device_base::NO_CAR;
+		}
+		if ( (tp_passageway_status_from_plc_to_dispatch->m_sensor_status1 & 0x04)== 1)
+		{
+			m_actual_front_overstep_the_boundary = Dispatch_device_base::BOUNDARY_OVERSTEP;
+		}
+		else
+		{
+			m_actual_front_overstep_the_boundary = Dispatch_device_base::BOUNDARY_NORMAL;
+		}
+		if ( (tp_passageway_status_from_plc_to_dispatch->m_sensor_status1 & 0x08)== 1)
+		{
+			m_actual_back_overstep_the_boundary = Dispatch_device_base::BOUNDARY_OVERSTEP;
+		}
+		else
+		{
+			m_actual_back_overstep_the_boundary = Dispatch_device_base::BOUNDARY_NORMAL;
+		}
+		if ( (tp_passageway_status_from_plc_to_dispatch->m_sensor_status1 & 0x10)== 1)
+		{
+			m_actual_height_overstep_the_boundary = Dispatch_device_base::BOUNDARY_OVERSTEP;
+		}
+		else
+		{
+			m_actual_height_overstep_the_boundary = Dispatch_device_base::BOUNDARY_NORMAL;
+		}
+		if ( (tp_passageway_status_from_plc_to_dispatch->m_sensor_status1 & 0x20)== 1)
+		{
+			m_actual_outside_door_sensor = Dispatch_device_base::HAVE_CAR;
+		}
+		else
+		{
+			m_actual_outside_door_sensor = Dispatch_device_base::NO_CAR;
+		}
+
+		if ( (tp_passageway_status_from_plc_to_dispatch->m_sensor_status1 & 0x40)== 1 &&
+			 (tp_passageway_status_from_plc_to_dispatch->m_sensor_status1 & 0x80)== 0)
+		{
+			m_actual_inside_door_motion = Dispatch_device_base::DOOR_OPEN;
+		}
+		else if ( (tp_passageway_status_from_plc_to_dispatch->m_sensor_status1 & 0x40)== 0 &&
+				  (tp_passageway_status_from_plc_to_dispatch->m_sensor_status1 & 0x80)== 1)
+		{
+			m_actual_inside_door_motion = Dispatch_device_base::DOOR_CLOSE;
+		}
+		else if ( (tp_passageway_status_from_plc_to_dispatch->m_sensor_status1 & 0x40)== 1 &&
+				  (tp_passageway_status_from_plc_to_dispatch->m_sensor_status1 & 0x80)== 1)
+		{
+			m_actual_inside_door_motion = Dispatch_device_base::DOOR_ERROR;
+		}
+		else if ( (tp_passageway_status_from_plc_to_dispatch->m_sensor_status1 & 0x40)== 0 &&
+				  (tp_passageway_status_from_plc_to_dispatch->m_sensor_status1 & 0x80)== 0)
+		{
+			m_actual_inside_door_motion = Dispatch_device_base::DOOR_UNKNOWN;
+		}
+
+		if ( (tp_passageway_status_from_plc_to_dispatch->m_sensor_status2 & 0x01)== 1 &&
+			 (tp_passageway_status_from_plc_to_dispatch->m_sensor_status2 & 0x02)== 0)
+		{
+			m_actual_outside_door_motion = Dispatch_device_base::DOOR_OPEN;
+		}
+		else if ( (tp_passageway_status_from_plc_to_dispatch->m_sensor_status2 & 0x01)== 0 &&
+				  (tp_passageway_status_from_plc_to_dispatch->m_sensor_status2 & 0x02)== 1)
+		{
+			m_actual_outside_door_motion = Dispatch_device_base::DOOR_CLOSE;
+		}
+		else if ( (tp_passageway_status_from_plc_to_dispatch->m_sensor_status2 & 0x01)== 1 &&
+				  (tp_passageway_status_from_plc_to_dispatch->m_sensor_status2 & 0x02)== 1)
+		{
+			m_actual_outside_door_motion = Dispatch_device_base::DOOR_ERROR;
+		}
+		else if ( (tp_passageway_status_from_plc_to_dispatch->m_sensor_status2 & 0x01)== 0 &&
+				  (tp_passageway_status_from_plc_to_dispatch->m_sensor_status2 & 0x02)== 0)
+		{
+			m_actual_outside_door_motion = Dispatch_device_base::DOOR_UNKNOWN;
+		}
+
+		if ( (tp_passageway_status_from_plc_to_dispatch->m_sensor_status2 & 0x03)== 1)
+		{
+			m_actual_turntable_load_status = Dispatch_device_base::HAVE_CAR;
+		}
+		else
+		{
+			m_actual_turntable_load_status = Dispatch_device_base::NO_CAR;
+		}
+
+		m_actual_turntable_direction = (Dispatch_device_base::Turntable_direction)tp_passageway_status_from_plc_to_dispatch->m_actual_turntable_direction;
+		memcpy(m_actual_error_code, tp_passageway_status_from_plc_to_dispatch->m_actual_error_code, 50);
+		memcpy(m_actual_warning_code, tp_passageway_status_from_plc_to_dispatch->m_actual_warning_code, 50);
+		m_actual_error_description = (char*)(tp_passageway_status_from_plc_to_dispatch->m_actual_error_description);
+
+		//重连之后,搬运器状态   E_DISCONNECT  ->>  E_THREE_LEVEL_WORK
+		if ( m_dispatch_device_status == Dispatch_device_base::E_DISCONNECT )
+		{
+			m_dispatch_device_status = Dispatch_device_base::E_THREE_LEVEL_WORK;
+		}
+	}
+	else if(std::chrono::system_clock::now() - m_status_updata_time > std::chrono::milliseconds(COMMUNICATION_OVER_TIME_MS))
+	{
+		m_dispatch_device_status = Dispatch_device_base::E_DISCONNECT;
+	}
+	//else 继续等待,直到消息刷新或者超时.
+
+	return Error_code::SUCCESS;
+}
+//从内存中读数据到任务单, 子类必须重载
+Error_manager Passageway::check_and_read_memory_to_task(std::shared_ptr<Task_Base> p_task)
+{
+	//检查任务类型,
+	if (p_task->get_task_type() != PASSAGEWAY_TASK)
+	{
+		return Error_manager(Error_code::PASSAGEWAY_TASK_TYPE_ERROR, Error_level::MINOR_ERROR,
+							 "Passageway::check_task_type  get_task_type() != PASSAGEWAY_TASK ");
+	}
+	else
+	{
+		std::unique_lock<std::mutex> t_lock(m_lock);
+		if ( m_respons_key == m_request_key && m_respons_status != RESPONS_WORKING )
+		{
+			Passageway_task* tp_passageway_task = (Passageway_task*)p_task.get();
+			std::unique_lock<std::mutex> t_lock1(tp_passageway_task->m_lock);
+
+			tp_passageway_task->m_respons_key = m_respons_key;
+			tp_passageway_task->m_respons_status = (Passageway_task::Respons_status)m_respons_status;
+			tp_passageway_task->m_respons_inside_door_motion = (Passageway_task::Door_motion)m_respons_inside_door_motion;
+			tp_passageway_task->m_respons_outside_door_motion = (Passageway_task::Door_motion)m_respons_outside_door_motion;
+			tp_passageway_task->m_respons_turntable_direction = (Passageway_task::Turntable_direction)m_respons_turntable_direction;
+
+			//如果故障,则添加错误码
+			if ( m_respons_status == RESPONS_MINOR_ERROR || m_respons_status == RESPONS_CRITICAL_ERROR )
+			{
+				//添加错误码
+				Error_manager t_error(PASSAGEWAY_RESPONS_ERROR, MINOR_ERROR, "m_respons_status is error");
+				tp_passageway_task->set_task_error_manager(t_error);
+			}
+
+			return Error_code::SUCCESS;
+		}
+			//返回没有收到数据
+		else
+		{
+			return Error_code::NODATA;
+		}
+	}
+	return Error_code::SUCCESS;
+}
+
+
+
+//取消下发的指令
+Error_manager Passageway::cancel_command()
+{
+	//以后再写 need programe
+	//目前调度和plc的通信指令做的很简单,没有暂停和急停 复位等操作.
+	//这里先空着,以后再写.
+	//调度模块单方面销毁任务, 不管底层plc的执行情况, 也不去告知plc任务取消.
+
+	return Error_code::SUCCESS;
+}
+
+
+
+

+ 83 - 0
dispatch/passageway.h

@@ -0,0 +1,83 @@
+//
+// Created by huli on 2021/3/16.
+//
+
+#ifndef NNXX_TESTS_PASSAGEWAY_H
+#define NNXX_TESTS_PASSAGEWAY_H
+
+#include "../dispatch/passageway_task.h"
+#include "../dispatch/dispatch_device_base.h"
+
+//一楼的出入口,通道口
+class Passageway:public Dispatch_device_base
+{
+public:
+	Passageway();
+	Passageway(const Passageway& other)= default;
+	Passageway& operator =(const Passageway& other)= default;
+	~Passageway();
+public://API functions
+	//检查任务类型, 子类必须重载, 用来检查输入的任务是否为子类所需的.
+	Error_manager check_task_type(std::shared_ptr<Task_Base> p_task);
+public://get or set member variable
+	//获取硬件设备的状态, 必须子类继承
+	Device_status get_actual_device_status();
+protected://member functions
+	//把任务单写入到内存中, 子类必须重载
+	Error_manager write_task_to_memory(std::shared_ptr<Task_Base> p_task);
+	//更新设备底层通信数据, 子类必须重载
+	Error_manager update_device_communication();
+	//从内存中读数据到任务单, 子类必须重载
+	Error_manager check_and_read_memory_to_task(std::shared_ptr<Task_Base> p_task);
+	//取消下发的指令, 子类必须重载, 用来向下发送命令取消任务.
+	Error_manager cancel_command();
+protected://member variable
+
+	//调度下发到plc
+	std::string							m_request_key;				//请求唯一码, 用作识别
+	//请求的目标坐标和动作
+	Door_motion							m_request_inside_door_motion;	//通道口 内门动作
+	Door_motion							m_request_outside_door_motion;	//通道口 外门动作
+	Turntable_direction					m_request_turntable_direction;	//通道口 转台方向
+
+
+	//plc反馈给调度
+	std::string							m_respons_key;				//应答的唯一码, 用作识别
+	Respons_status						m_respons_status;			//指令完成状态, 搬运器答复指令, 返回任务完成的情况
+	//答复的实际坐标和动作
+	Door_motion							m_respons_inside_door_motion;	//通道口 内门动作
+	Door_motion							m_respons_outside_door_motion;	//通道口 外门动作
+	Turntable_direction					m_respons_turntable_direction;	//通道口 转台方向
+
+
+
+
+	//硬件状态, 目前只做显示判断
+	std::chrono::system_clock::time_point	m_status_updata_time;	//状态更新时间点
+	unsigned char						m_last_heartbeat;			//上一次的心跳
+	//搬运器的设备状态数据,
+	Device_status						m_actual_device_status;			//通道口的硬件设备状态
+	Load_status							m_actual_inside_load_status;	//通道口的内部负载状态, 门内地感是否有车.
+	Load_status							m_actual_outside_load_status;	//通道口的外部负载状态, 门外地感是否有车.
+	Overstep_the_boundary				m_actual_front_overstep_the_boundary;	//通道口 汽车前边界
+	Overstep_the_boundary				m_actual_back_overstep_the_boundary;	//通道口 汽车前边界
+	Overstep_the_boundary				m_actual_height_overstep_the_boundary;	//通道口 车辆是否超高
+	Load_status							m_actual_outside_door_sensor;	//通道口 的外门处的传感器, 判断是否有车经过外门
+	//通道口的真实状态, 可能是路径中间的坐标
+	Door_motion							m_actual_inside_door_motion;	//通道口 内门动作
+	Door_motion							m_actual_outside_door_motion;	//通道口 外门动作
+	Load_status							m_actual_turntable_load_status;	//通道口 转盘负载状态, 是否有车.
+	Turntable_direction					m_actual_turntable_direction;	//通道口 转台方向
+
+	//搬运器设备的错误码
+	unsigned char						m_actual_error_code[50];	//搬运器设备的故障信息位
+	unsigned char						m_actual_warning_code[50];	//搬运器设备的警告信息位
+	std::string							m_actual_error_description;//搬运器设备的错误描述
+
+
+private:
+
+};
+
+
+#endif //NNXX_TESTS_PASSAGEWAY_H

+ 33 - 0
dispatch/passageway_task.cpp

@@ -0,0 +1,33 @@
+//
+// Created by huli on 2021/3/16.
+//
+
+#include "passageway_task.h"
+
+
+Passageway_task::Passageway_task()
+{
+	//构造函数锁定任务类型为 LOCATE_MANGER_TASK,后续不允许更改
+	m_task_type = CARRIER_TASK;
+	m_task_statu = TASK_CREATED;
+	m_task_statu_information.clear();
+	m_task_error_manager.error_manager_clear_all();
+
+	m_request_inside_door_motion = DOOR_UNKNOWN;
+	m_request_outside_door_motion = DOOR_UNKNOWN;
+	m_request_turntable_direction = TURNTABLE_DIRECTION_UNKNOWN;
+
+
+	m_respons_status = RESPONS_WORKING;			//指令完成状态, 搬运器答复指令, 返回任务完成的情况
+	m_respons_inside_door_motion = DOOR_UNKNOWN;
+	m_respons_outside_door_motion = DOOR_UNKNOWN;
+	m_respons_turntable_direction = TURNTABLE_DIRECTION_UNKNOWN;
+
+
+}
+
+Passageway_task::~Passageway_task()
+{
+
+}
+

+ 78 - 0
dispatch/passageway_task.h

@@ -0,0 +1,78 @@
+//
+// Created by huli on 2021/3/16.
+//
+
+#ifndef NNXX_TESTS_PASSAGEWAY_TASK_H
+#define NNXX_TESTS_PASSAGEWAY_TASK_H
+
+#include "../error_code/error_code.h"
+#include "../task/task_command_manager.h"
+#include "../task/task_base.h"
+#include <mutex>
+
+class Passageway_task:public Task_Base
+{
+public:
+	//指令完成状态, 搬运器答复指令, 返回任务完成的情况
+	enum Respons_status
+	{
+		RESPONS_WORKING             = 0,    //正常
+		RESPONS_OVER               	= 1,    //任务完成
+		RESPONS_MINOR_ERROR			= 100,	//一般故障, 可恢复
+		RESPONS_CRITICAL_ERROR		= 101,	//致命故障,不可恢复
+	};
+
+	//7号出口 转台方向
+	enum Turntable_direction
+	{
+		TURNTABLE_DIRECTION_UNKNOWN				= 0,	//方向未知,
+		TURNTABLE_DIRECTION_INSIDE 				= 1,    //方向朝里,对接内门的小跑车
+		TURNTABLE_DIRECTION_OUTSIDE  			= 2,    //没车朝外,对接外门的出口
+	};
+
+	//出入口 门的开关状态
+	enum Door_motion
+	{
+		DOOR_UNKNOWN            = 0,    //门的开关状态 未知, 或者工作到一半,正在工作中.
+		DOOR_OPEN               = 1,    //开门
+		DOOR_CLOSE				= 2,	//关门
+		DOOR_ERROR				= 3,	//
+	};
+
+	Passageway_task();
+	Passageway_task(const Passageway_task& other)= default;
+	Passageway_task& operator =(const Passageway_task& other)= default;
+	~Passageway_task();
+public://API functions
+
+public://get or set member variable
+
+protected://member functions
+
+public://member variable
+
+	std::mutex							m_lock;	//锁
+
+	//调度下发到plc
+	std::string							m_request_key;				//请求唯一码, 用作识别
+	//请求的目标坐标和动作
+	Door_motion							m_request_inside_door_motion;	//通道口 内门动作
+	Door_motion							m_request_outside_door_motion;	//通道口 外门动作
+	Turntable_direction					m_request_turntable_direction;	//通道口 转台方向
+
+
+	//plc反馈给调度
+	std::string							m_respons_key;				//应答的唯一码, 用作识别
+	Respons_status						m_respons_status;			//指令完成状态, 搬运器答复指令, 返回任务完成的情况
+	//答复的实际坐标和动作
+	Door_motion							m_respons_inside_door_motion;	//通道口 内门动作
+	Door_motion							m_respons_outside_door_motion;	//通道口 外门动作
+	Turntable_direction					m_respons_turntable_direction;	//通道口 转台方向
+
+
+private:
+
+};
+
+
+#endif //NNXX_TESTS_PASSAGEWAY_TASK_H

+ 180 - 67
message/dispatch_control.pb.cc

@@ -135,7 +135,7 @@ void InitDefaultsDispatch_control_response_msg() {
 }
 
 ::google::protobuf::Metadata file_level_metadata[4];
-const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[2];
+const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[3];
 
 const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Dispatch_plan_request_msg, _has_bits_),
@@ -184,13 +184,15 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUT
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Dispatch_control_request_msg, dispatch_source_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Dispatch_control_request_msg, dispatch_destination_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Dispatch_control_request_msg, error_manager_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Dispatch_control_request_msg, dispatch_device_target_status_),
   1,
   0,
-  5,
   6,
+  7,
   3,
   4,
   2,
+  5,
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Dispatch_control_response_msg, _has_bits_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Dispatch_control_response_msg, _internal_metadata_),
   ~0u,  // no _extensions_
@@ -203,19 +205,21 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUT
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Dispatch_control_response_msg, dispatch_source_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Dispatch_control_response_msg, dispatch_destination_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Dispatch_control_response_msg, error_manager_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Dispatch_control_response_msg, dispatch_device_target_status_),
   1,
   0,
-  5,
   6,
+  7,
   3,
   4,
   2,
+  5,
 };
 static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
   { 0, 11, sizeof(::message::Dispatch_plan_request_msg)},
   { 17, 28, sizeof(::message::Dispatch_plan_response_msg)},
-  { 34, 46, sizeof(::message::Dispatch_control_request_msg)},
-  { 53, 65, sizeof(::message::Dispatch_control_response_msg)},
+  { 34, 47, sizeof(::message::Dispatch_control_request_msg)},
+  { 55, 68, sizeof(::message::Dispatch_control_response_msg)},
 };
 
 static ::google::protobuf::Message const * const file_default_instances[] = {
@@ -260,7 +264,7 @@ void AddDescriptorsImpl() {
       "patch_task_type\030\003 \001(\0162\033.message.Dispatch"
       "_task_type\022\027\n\017dispatch_source\030\004 \001(\005\022\034\n\024d"
       "ispatch_destination\030\005 \001(\005\022-\n\rerror_manag"
-      "er\030\006 \001(\0132\026.message.Error_manager\"\266\002\n\034Dis"
+      "er\030\006 \001(\0132\026.message.Error_manager\"\205\003\n\034Dis"
       "patch_control_request_msg\022%\n\tbase_info\030\001"
       " \002(\0132\022.message.Base_info\022\023\n\013command_key\030"
       "\002 \002(\t\0227\n\022dispatch_task_type\030\003 \002(\0162\033.mess"
@@ -268,43 +272,49 @@ void AddDescriptorsImpl() {
       "e_type\030\004 \001(\0162\035.message.Dispatch_device_t"
       "ype\022\027\n\017dispatch_source\030\005 \001(\005\022\034\n\024dispatch"
       "_destination\030\006 \001(\005\022-\n\rerror_manager\030\007 \001("
-      "\0132\026.message.Error_manager\"\267\002\n\035Dispatch_c"
-      "ontrol_response_msg\022%\n\tbase_info\030\001 \002(\0132\022"
-      ".message.Base_info\022\023\n\013command_key\030\002 \002(\t\022"
-      "7\n\022dispatch_task_type\030\003 \001(\0162\033.message.Di"
-      "spatch_task_type\022;\n\024dispatch_device_type"
-      "\030\004 \001(\0162\035.message.Dispatch_device_type\022\027\n"
-      "\017dispatch_source\030\005 \001(\005\022\034\n\024dispatch_desti"
-      "nation\030\006 \001(\005\022-\n\rerror_manager\030\007 \001(\0132\026.me"
-      "ssage.Error_manager*\333\005\n\022Dispatch_task_ty"
-      "pe\022\027\n\023DISPATCH_PLAN_STORE\020e\022\030\n\024DISPATCH_"
-      "PLAN_PICKUP\020f\022\036\n\032ROBOT_CATCH_CAR_FROM_IN"
-      "LET\020\001\022\034\n\030ROBOT_PUT_CAR_TO_CARRIER\020\002\022 \n\034R"
-      "OBOT_CATCH_CAR_FROM_CARRIER\020\003\022\033\n\027ROBOT_P"
-      "UT_CAR_TO_OUTLET\020\004\022\016\n\nROBOT_MOVE\020\005\022\"\n\036CA"
-      "RRIER_RECEIVE_CAR_FROM_ROBOT\020\013\022%\n!CARRIE"
-      "R_STORE_CAR_TO_PARKINGSPACE\020\014\022(\n$CARRIER"
-      "_STORE_CAR_TO_PARKINGSPACE_EX\020z\022(\n$CARRI"
-      "ER_PICKUP_CAR_FROM_PARKINGSPACE\020\r\022 \n\034CAR"
-      "RIER_DELIVER_CAR_TO_ROBOT\020\016\022\020\n\014CARRIER_M"
-      "OVE\020\017\022 \n\034PASSAGEWAY_OPEN_OUTSIDE_DOOR\020\025\022"
-      "!\n\035PASSAGEWAY_CLOSE_OUTSIDE_DOOR\020\026\022\037\n\033PA"
-      "SSAGEWAY_OPEN_INSIDE_DOOR\020\027\022 \n\034PASSAGEWA"
-      "Y_CLOSE_INSIDE_DOOR\020\030\022*\n&PASSAGEWAY_ROTA"
-      "TE_TURNTABLE_TO_CARRIER\020\031\022)\n%PASSAGEWAY_"
-      "ROTATE_TURNTABLE_TO_OUTLET\020\032\022\023\n\017DISPATCH"
-      "_FINISH\020\036\022\023\n\017DISPATCH_CANCEL\020\037\022\022\n\016DISPAT"
-      "CH_PAUSE\020(\022\025\n\021DISPATCH_RESERVED\0202*\370\001\n\024Di"
-      "spatch_device_type\022\013\n\007ROBOT_1\020e\022\013\n\007ROBOT"
-      "_2\020f\022\016\n\tCARRIER_1\020\311\001\022\016\n\tCARRIER_2\020\312\001\022\016\n\t"
-      "CARRIER_3\020\313\001\022\021\n\014PASSAGEWAY_0\020\254\002\022\021\n\014PASSA"
-      "GEWAY_1\020\255\002\022\021\n\014PASSAGEWAY_2\020\256\002\022\021\n\014PASSAGE"
-      "WAY_3\020\257\002\022\021\n\014PASSAGEWAY_4\020\260\002\022\021\n\014PASSAGEWA"
-      "Y_5\020\261\002\022\021\n\014PASSAGEWAY_6\020\262\002\022\021\n\014PASSAGEWAY_"
-      "7\020\263\002"
+      "\0132\026.message.Error_manager\022M\n\035dispatch_de"
+      "vice_target_status\030\010 \001(\0162&.message.Dispa"
+      "tch_device_target_status\"\206\003\n\035Dispatch_co"
+      "ntrol_response_msg\022%\n\tbase_info\030\001 \002(\0132\022."
+      "message.Base_info\022\023\n\013command_key\030\002 \002(\t\0227"
+      "\n\022dispatch_task_type\030\003 \001(\0162\033.message.Dis"
+      "patch_task_type\022;\n\024dispatch_device_type\030"
+      "\004 \001(\0162\035.message.Dispatch_device_type\022\027\n\017"
+      "dispatch_source\030\005 \001(\005\022\034\n\024dispatch_destin"
+      "ation\030\006 \001(\005\022-\n\rerror_manager\030\007 \001(\0132\026.mes"
+      "sage.Error_manager\022M\n\035dispatch_device_ta"
+      "rget_status\030\010 \001(\0162&.message.Dispatch_dev"
+      "ice_target_status*\333\005\n\022Dispatch_task_type"
+      "\022\027\n\023DISPATCH_PLAN_STORE\020e\022\030\n\024DISPATCH_PL"
+      "AN_PICKUP\020f\022\036\n\032ROBOT_CATCH_CAR_FROM_INLE"
+      "T\020\001\022\034\n\030ROBOT_PUT_CAR_TO_CARRIER\020\002\022 \n\034ROB"
+      "OT_CATCH_CAR_FROM_CARRIER\020\003\022\033\n\027ROBOT_PUT"
+      "_CAR_TO_OUTLET\020\004\022\016\n\nROBOT_MOVE\020\005\022\"\n\036CARR"
+      "IER_RECEIVE_CAR_FROM_ROBOT\020\013\022%\n!CARRIER_"
+      "STORE_CAR_TO_PARKINGSPACE\020\014\022(\n$CARRIER_S"
+      "TORE_CAR_TO_PARKINGSPACE_EX\020z\022(\n$CARRIER"
+      "_PICKUP_CAR_FROM_PARKINGSPACE\020\r\022 \n\034CARRI"
+      "ER_DELIVER_CAR_TO_ROBOT\020\016\022\020\n\014CARRIER_MOV"
+      "E\020\017\022 \n\034PASSAGEWAY_OPEN_OUTSIDE_DOOR\020\025\022!\n"
+      "\035PASSAGEWAY_CLOSE_OUTSIDE_DOOR\020\026\022\037\n\033PASS"
+      "AGEWAY_OPEN_INSIDE_DOOR\020\027\022 \n\034PASSAGEWAY_"
+      "CLOSE_INSIDE_DOOR\020\030\022*\n&PASSAGEWAY_ROTATE"
+      "_TURNTABLE_TO_CARRIER\020\031\022)\n%PASSAGEWAY_RO"
+      "TATE_TURNTABLE_TO_OUTLET\020\032\022\023\n\017DISPATCH_F"
+      "INISH\020\036\022\023\n\017DISPATCH_CANCEL\020\037\022\022\n\016DISPATCH"
+      "_PAUSE\020(\022\025\n\021DISPATCH_RESERVED\0202*\370\001\n\024Disp"
+      "atch_device_type\022\013\n\007ROBOT_1\020e\022\013\n\007ROBOT_2"
+      "\020f\022\016\n\tCARRIER_1\020\311\001\022\016\n\tCARRIER_2\020\312\001\022\016\n\tCA"
+      "RRIER_3\020\313\001\022\021\n\014PASSAGEWAY_0\020\254\002\022\021\n\014PASSAGE"
+      "WAY_1\020\255\002\022\021\n\014PASSAGEWAY_2\020\256\002\022\021\n\014PASSAGEWA"
+      "Y_3\020\257\002\022\021\n\014PASSAGEWAY_4\020\260\002\022\021\n\014PASSAGEWAY_"
+      "5\020\261\002\022\021\n\014PASSAGEWAY_6\020\262\002\022\021\n\014PASSAGEWAY_7\020"
+      "\263\002*^\n\035Dispatch_device_target_status\022\014\n\010E"
+      "_UNKNOW\020\000\022\n\n\006E_IDLE\020\001\022\n\n\006E_BUSY\020\002\022\013\n\007E_R"
+      "EADY\020\003\022\n\n\006E_WAIT\020\004"
   };
   ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
-      descriptor, 2164);
+      descriptor, 2418);
   ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
     "dispatch_control.proto", &protobuf_RegisterTypes);
   ::protobuf_message_5fbase_2eproto::AddDescriptors();
@@ -382,6 +392,23 @@ bool Dispatch_device_type_IsValid(int value) {
   }
 }
 
+const ::google::protobuf::EnumDescriptor* Dispatch_device_target_status_descriptor() {
+  protobuf_dispatch_5fcontrol_2eproto::protobuf_AssignDescriptorsOnce();
+  return protobuf_dispatch_5fcontrol_2eproto::file_level_enum_descriptors[2];
+}
+bool Dispatch_device_target_status_IsValid(int value) {
+  switch (value) {
+    case 0:
+    case 1:
+    case 2:
+    case 3:
+    case 4:
+      return true;
+    default:
+      return false;
+  }
+}
+
 
 // ===================================================================
 
@@ -1475,6 +1502,7 @@ const int Dispatch_control_request_msg::kDispatchDeviceTypeFieldNumber;
 const int Dispatch_control_request_msg::kDispatchSourceFieldNumber;
 const int Dispatch_control_request_msg::kDispatchDestinationFieldNumber;
 const int Dispatch_control_request_msg::kErrorManagerFieldNumber;
+const int Dispatch_control_request_msg::kDispatchDeviceTargetStatusFieldNumber;
 #endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
 
 Dispatch_control_request_msg::Dispatch_control_request_msg()
@@ -1515,8 +1543,8 @@ void Dispatch_control_request_msg::SharedCtor() {
   _cached_size_ = 0;
   command_key_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
   ::memset(&base_info_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&dispatch_destination_) -
-      reinterpret_cast<char*>(&base_info_)) + sizeof(dispatch_destination_));
+      reinterpret_cast<char*>(&dispatch_device_target_status_) -
+      reinterpret_cast<char*>(&base_info_)) + sizeof(dispatch_device_target_status_));
   dispatch_task_type_ = 101;
   dispatch_device_type_ = 101;
 }
@@ -1576,10 +1604,10 @@ void Dispatch_control_request_msg::Clear() {
       error_manager_->Clear();
     }
   }
-  if (cached_has_bits & 120u) {
+  if (cached_has_bits & 248u) {
     ::memset(&dispatch_source_, 0, static_cast<size_t>(
-        reinterpret_cast<char*>(&dispatch_destination_) -
-        reinterpret_cast<char*>(&dispatch_source_)) + sizeof(dispatch_destination_));
+        reinterpret_cast<char*>(&dispatch_device_target_status_) -
+        reinterpret_cast<char*>(&dispatch_source_)) + sizeof(dispatch_device_target_status_));
     dispatch_task_type_ = 101;
     dispatch_device_type_ = 101;
   }
@@ -1705,6 +1733,26 @@ bool Dispatch_control_request_msg::MergePartialFromCodedStream(
         break;
       }
 
+      // optional .message.Dispatch_device_target_status dispatch_device_target_status = 8;
+      case 8: {
+        if (static_cast< ::google::protobuf::uint8>(tag) ==
+            static_cast< ::google::protobuf::uint8>(64u /* 64 & 0xFF */)) {
+          int value;
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
+                 input, &value)));
+          if (::message::Dispatch_device_target_status_IsValid(value)) {
+            set_dispatch_device_target_status(static_cast< ::message::Dispatch_device_target_status >(value));
+          } else {
+            mutable_unknown_fields()->AddVarint(
+                8, static_cast< ::google::protobuf::uint64>(value));
+          }
+        } else {
+          goto handle_unusual;
+        }
+        break;
+      }
+
       default: {
       handle_unusual:
         if (tag == 0) {
@@ -1749,13 +1797,13 @@ void Dispatch_control_request_msg::SerializeWithCachedSizes(
   }
 
   // required .message.Dispatch_task_type dispatch_task_type = 3;
-  if (cached_has_bits & 0x00000020u) {
+  if (cached_has_bits & 0x00000040u) {
     ::google::protobuf::internal::WireFormatLite::WriteEnum(
       3, this->dispatch_task_type(), output);
   }
 
   // optional .message.Dispatch_device_type dispatch_device_type = 4;
-  if (cached_has_bits & 0x00000040u) {
+  if (cached_has_bits & 0x00000080u) {
     ::google::protobuf::internal::WireFormatLite::WriteEnum(
       4, this->dispatch_device_type(), output);
   }
@@ -1776,6 +1824,12 @@ void Dispatch_control_request_msg::SerializeWithCachedSizes(
       7, *this->error_manager_, output);
   }
 
+  // optional .message.Dispatch_device_target_status dispatch_device_target_status = 8;
+  if (cached_has_bits & 0x00000020u) {
+    ::google::protobuf::internal::WireFormatLite::WriteEnum(
+      8, this->dispatch_device_target_status(), output);
+  }
+
   if (_internal_metadata_.have_unknown_fields()) {
     ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
         _internal_metadata_.unknown_fields(), output);
@@ -1810,13 +1864,13 @@ void Dispatch_control_request_msg::SerializeWithCachedSizes(
   }
 
   // required .message.Dispatch_task_type dispatch_task_type = 3;
-  if (cached_has_bits & 0x00000020u) {
+  if (cached_has_bits & 0x00000040u) {
     target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
       3, this->dispatch_task_type(), target);
   }
 
   // optional .message.Dispatch_device_type dispatch_device_type = 4;
-  if (cached_has_bits & 0x00000040u) {
+  if (cached_has_bits & 0x00000080u) {
     target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
       4, this->dispatch_device_type(), target);
   }
@@ -1838,6 +1892,12 @@ void Dispatch_control_request_msg::SerializeWithCachedSizes(
         7, *this->error_manager_, deterministic, target);
   }
 
+  // optional .message.Dispatch_device_target_status dispatch_device_target_status = 8;
+  if (cached_has_bits & 0x00000020u) {
+    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
+      8, this->dispatch_device_target_status(), target);
+  }
+
   if (_internal_metadata_.have_unknown_fields()) {
     target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
         _internal_metadata_.unknown_fields(), target);
@@ -1881,7 +1941,7 @@ size_t Dispatch_control_request_msg::ByteSizeLong() const {
       ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
         _internal_metadata_.unknown_fields());
   }
-  if (((_has_bits_[0] & 0x00000023) ^ 0x00000023) == 0) {  // All required fields are present.
+  if (((_has_bits_[0] & 0x00000043) ^ 0x00000043) == 0) {  // All required fields are present.
     // required string command_key = 2;
     total_size += 1 +
       ::google::protobuf::internal::WireFormatLite::StringSize(
@@ -1899,7 +1959,7 @@ size_t Dispatch_control_request_msg::ByteSizeLong() const {
   } else {
     total_size += RequiredFieldsByteSizeFallback();
   }
-  if (_has_bits_[0 / 32] & 28u) {
+  if (_has_bits_[0 / 32] & 60u) {
     // optional .message.Error_manager error_manager = 7;
     if (has_error_manager()) {
       total_size += 1 +
@@ -1921,6 +1981,12 @@ size_t Dispatch_control_request_msg::ByteSizeLong() const {
           this->dispatch_destination());
     }
 
+    // optional .message.Dispatch_device_target_status dispatch_device_target_status = 8;
+    if (has_dispatch_device_target_status()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::EnumSize(this->dispatch_device_target_status());
+    }
+
   }
   // optional .message.Dispatch_device_type dispatch_device_type = 4;
   if (has_dispatch_device_type()) {
@@ -1958,7 +2024,7 @@ void Dispatch_control_request_msg::MergeFrom(const Dispatch_control_request_msg&
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 127u) {
+  if (cached_has_bits & 255u) {
     if (cached_has_bits & 0x00000001u) {
       set_has_command_key();
       command_key_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.command_key_);
@@ -1976,9 +2042,12 @@ void Dispatch_control_request_msg::MergeFrom(const Dispatch_control_request_msg&
       dispatch_destination_ = from.dispatch_destination_;
     }
     if (cached_has_bits & 0x00000020u) {
-      dispatch_task_type_ = from.dispatch_task_type_;
+      dispatch_device_target_status_ = from.dispatch_device_target_status_;
     }
     if (cached_has_bits & 0x00000040u) {
+      dispatch_task_type_ = from.dispatch_task_type_;
+    }
+    if (cached_has_bits & 0x00000080u) {
       dispatch_device_type_ = from.dispatch_device_type_;
     }
     _has_bits_[0] |= cached_has_bits;
@@ -2000,7 +2069,7 @@ void Dispatch_control_request_msg::CopyFrom(const Dispatch_control_request_msg&
 }
 
 bool Dispatch_control_request_msg::IsInitialized() const {
-  if ((_has_bits_[0] & 0x00000023) != 0x00000023) return false;
+  if ((_has_bits_[0] & 0x00000043) != 0x00000043) return false;
   if (has_base_info()) {
     if (!this->base_info_->IsInitialized()) return false;
   }
@@ -2021,6 +2090,7 @@ void Dispatch_control_request_msg::InternalSwap(Dispatch_control_request_msg* ot
   swap(error_manager_, other->error_manager_);
   swap(dispatch_source_, other->dispatch_source_);
   swap(dispatch_destination_, other->dispatch_destination_);
+  swap(dispatch_device_target_status_, other->dispatch_device_target_status_);
   swap(dispatch_task_type_, other->dispatch_task_type_);
   swap(dispatch_device_type_, other->dispatch_device_type_);
   swap(_has_bits_[0], other->_has_bits_[0]);
@@ -2058,6 +2128,7 @@ const int Dispatch_control_response_msg::kDispatchDeviceTypeFieldNumber;
 const int Dispatch_control_response_msg::kDispatchSourceFieldNumber;
 const int Dispatch_control_response_msg::kDispatchDestinationFieldNumber;
 const int Dispatch_control_response_msg::kErrorManagerFieldNumber;
+const int Dispatch_control_response_msg::kDispatchDeviceTargetStatusFieldNumber;
 #endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
 
 Dispatch_control_response_msg::Dispatch_control_response_msg()
@@ -2098,8 +2169,8 @@ void Dispatch_control_response_msg::SharedCtor() {
   _cached_size_ = 0;
   command_key_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
   ::memset(&base_info_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&dispatch_destination_) -
-      reinterpret_cast<char*>(&base_info_)) + sizeof(dispatch_destination_));
+      reinterpret_cast<char*>(&dispatch_device_target_status_) -
+      reinterpret_cast<char*>(&base_info_)) + sizeof(dispatch_device_target_status_));
   dispatch_task_type_ = 101;
   dispatch_device_type_ = 101;
 }
@@ -2159,10 +2230,10 @@ void Dispatch_control_response_msg::Clear() {
       error_manager_->Clear();
     }
   }
-  if (cached_has_bits & 120u) {
+  if (cached_has_bits & 248u) {
     ::memset(&dispatch_source_, 0, static_cast<size_t>(
-        reinterpret_cast<char*>(&dispatch_destination_) -
-        reinterpret_cast<char*>(&dispatch_source_)) + sizeof(dispatch_destination_));
+        reinterpret_cast<char*>(&dispatch_device_target_status_) -
+        reinterpret_cast<char*>(&dispatch_source_)) + sizeof(dispatch_device_target_status_));
     dispatch_task_type_ = 101;
     dispatch_device_type_ = 101;
   }
@@ -2288,6 +2359,26 @@ bool Dispatch_control_response_msg::MergePartialFromCodedStream(
         break;
       }
 
+      // optional .message.Dispatch_device_target_status dispatch_device_target_status = 8;
+      case 8: {
+        if (static_cast< ::google::protobuf::uint8>(tag) ==
+            static_cast< ::google::protobuf::uint8>(64u /* 64 & 0xFF */)) {
+          int value;
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
+                 input, &value)));
+          if (::message::Dispatch_device_target_status_IsValid(value)) {
+            set_dispatch_device_target_status(static_cast< ::message::Dispatch_device_target_status >(value));
+          } else {
+            mutable_unknown_fields()->AddVarint(
+                8, static_cast< ::google::protobuf::uint64>(value));
+          }
+        } else {
+          goto handle_unusual;
+        }
+        break;
+      }
+
       default: {
       handle_unusual:
         if (tag == 0) {
@@ -2332,13 +2423,13 @@ void Dispatch_control_response_msg::SerializeWithCachedSizes(
   }
 
   // optional .message.Dispatch_task_type dispatch_task_type = 3;
-  if (cached_has_bits & 0x00000020u) {
+  if (cached_has_bits & 0x00000040u) {
     ::google::protobuf::internal::WireFormatLite::WriteEnum(
       3, this->dispatch_task_type(), output);
   }
 
   // optional .message.Dispatch_device_type dispatch_device_type = 4;
-  if (cached_has_bits & 0x00000040u) {
+  if (cached_has_bits & 0x00000080u) {
     ::google::protobuf::internal::WireFormatLite::WriteEnum(
       4, this->dispatch_device_type(), output);
   }
@@ -2359,6 +2450,12 @@ void Dispatch_control_response_msg::SerializeWithCachedSizes(
       7, *this->error_manager_, output);
   }
 
+  // optional .message.Dispatch_device_target_status dispatch_device_target_status = 8;
+  if (cached_has_bits & 0x00000020u) {
+    ::google::protobuf::internal::WireFormatLite::WriteEnum(
+      8, this->dispatch_device_target_status(), output);
+  }
+
   if (_internal_metadata_.have_unknown_fields()) {
     ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
         _internal_metadata_.unknown_fields(), output);
@@ -2393,13 +2490,13 @@ void Dispatch_control_response_msg::SerializeWithCachedSizes(
   }
 
   // optional .message.Dispatch_task_type dispatch_task_type = 3;
-  if (cached_has_bits & 0x00000020u) {
+  if (cached_has_bits & 0x00000040u) {
     target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
       3, this->dispatch_task_type(), target);
   }
 
   // optional .message.Dispatch_device_type dispatch_device_type = 4;
-  if (cached_has_bits & 0x00000040u) {
+  if (cached_has_bits & 0x00000080u) {
     target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
       4, this->dispatch_device_type(), target);
   }
@@ -2421,6 +2518,12 @@ void Dispatch_control_response_msg::SerializeWithCachedSizes(
         7, *this->error_manager_, deterministic, target);
   }
 
+  // optional .message.Dispatch_device_target_status dispatch_device_target_status = 8;
+  if (cached_has_bits & 0x00000020u) {
+    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
+      8, this->dispatch_device_target_status(), target);
+  }
+
   if (_internal_metadata_.have_unknown_fields()) {
     target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
         _internal_metadata_.unknown_fields(), target);
@@ -2472,7 +2575,7 @@ size_t Dispatch_control_response_msg::ByteSizeLong() const {
   } else {
     total_size += RequiredFieldsByteSizeFallback();
   }
-  if (_has_bits_[0 / 32] & 124u) {
+  if (_has_bits_[0 / 32] & 252u) {
     // optional .message.Error_manager error_manager = 7;
     if (has_error_manager()) {
       total_size += 1 +
@@ -2494,6 +2597,12 @@ size_t Dispatch_control_response_msg::ByteSizeLong() const {
           this->dispatch_destination());
     }
 
+    // optional .message.Dispatch_device_target_status dispatch_device_target_status = 8;
+    if (has_dispatch_device_target_status()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::EnumSize(this->dispatch_device_target_status());
+    }
+
     // optional .message.Dispatch_task_type dispatch_task_type = 3;
     if (has_dispatch_task_type()) {
       total_size += 1 +
@@ -2537,7 +2646,7 @@ void Dispatch_control_response_msg::MergeFrom(const Dispatch_control_response_ms
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 127u) {
+  if (cached_has_bits & 255u) {
     if (cached_has_bits & 0x00000001u) {
       set_has_command_key();
       command_key_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.command_key_);
@@ -2555,9 +2664,12 @@ void Dispatch_control_response_msg::MergeFrom(const Dispatch_control_response_ms
       dispatch_destination_ = from.dispatch_destination_;
     }
     if (cached_has_bits & 0x00000020u) {
-      dispatch_task_type_ = from.dispatch_task_type_;
+      dispatch_device_target_status_ = from.dispatch_device_target_status_;
     }
     if (cached_has_bits & 0x00000040u) {
+      dispatch_task_type_ = from.dispatch_task_type_;
+    }
+    if (cached_has_bits & 0x00000080u) {
       dispatch_device_type_ = from.dispatch_device_type_;
     }
     _has_bits_[0] |= cached_has_bits;
@@ -2600,6 +2712,7 @@ void Dispatch_control_response_msg::InternalSwap(Dispatch_control_response_msg*
   swap(error_manager_, other->error_manager_);
   swap(dispatch_source_, other->dispatch_source_);
   swap(dispatch_destination_, other->dispatch_destination_);
+  swap(dispatch_device_target_status_, other->dispatch_device_target_status_);
   swap(dispatch_task_type_, other->dispatch_task_type_);
   swap(dispatch_device_type_, other->dispatch_device_type_);
   swap(_has_bits_[0], other->_has_bits_[0]);

+ 109 - 12
message/dispatch_control.pb.h

@@ -145,6 +145,28 @@ inline bool Dispatch_device_type_Parse(
   return ::google::protobuf::internal::ParseNamedEnum<Dispatch_device_type>(
     Dispatch_device_type_descriptor(), name, value);
 }
+enum Dispatch_device_target_status {
+  E_UNKNOW = 0,
+  E_IDLE = 1,
+  E_BUSY = 2,
+  E_READY = 3,
+  E_WAIT = 4
+};
+bool Dispatch_device_target_status_IsValid(int value);
+const Dispatch_device_target_status Dispatch_device_target_status_MIN = E_UNKNOW;
+const Dispatch_device_target_status Dispatch_device_target_status_MAX = E_WAIT;
+const int Dispatch_device_target_status_ARRAYSIZE = Dispatch_device_target_status_MAX + 1;
+
+const ::google::protobuf::EnumDescriptor* Dispatch_device_target_status_descriptor();
+inline const ::std::string& Dispatch_device_target_status_Name(Dispatch_device_target_status value) {
+  return ::google::protobuf::internal::NameOfEnum(
+    Dispatch_device_target_status_descriptor(), value);
+}
+inline bool Dispatch_device_target_status_Parse(
+    const ::std::string& name, Dispatch_device_target_status* value) {
+  return ::google::protobuf::internal::ParseNamedEnum<Dispatch_device_target_status>(
+    Dispatch_device_target_status_descriptor(), name, value);
+}
 // ===================================================================
 
 class Dispatch_plan_request_msg : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:message.Dispatch_plan_request_msg) */ {
@@ -633,6 +655,13 @@ class Dispatch_control_request_msg : public ::google::protobuf::Message /* @@pro
   ::google::protobuf::int32 dispatch_destination() const;
   void set_dispatch_destination(::google::protobuf::int32 value);
 
+  // optional .message.Dispatch_device_target_status dispatch_device_target_status = 8;
+  bool has_dispatch_device_target_status() const;
+  void clear_dispatch_device_target_status();
+  static const int kDispatchDeviceTargetStatusFieldNumber = 8;
+  ::message::Dispatch_device_target_status dispatch_device_target_status() const;
+  void set_dispatch_device_target_status(::message::Dispatch_device_target_status value);
+
   // required .message.Dispatch_task_type dispatch_task_type = 3;
   bool has_dispatch_task_type() const;
   void clear_dispatch_task_type();
@@ -663,6 +692,8 @@ class Dispatch_control_request_msg : public ::google::protobuf::Message /* @@pro
   void clear_has_dispatch_destination();
   void set_has_error_manager();
   void clear_has_error_manager();
+  void set_has_dispatch_device_target_status();
+  void clear_has_dispatch_device_target_status();
 
   // helper for ByteSizeLong()
   size_t RequiredFieldsByteSizeFallback() const;
@@ -675,6 +706,7 @@ class Dispatch_control_request_msg : public ::google::protobuf::Message /* @@pro
   ::message::Error_manager* error_manager_;
   ::google::protobuf::int32 dispatch_source_;
   ::google::protobuf::int32 dispatch_destination_;
+  int dispatch_device_target_status_;
   int dispatch_task_type_;
   int dispatch_device_type_;
   friend struct ::protobuf_dispatch_5fcontrol_2eproto::TableStruct;
@@ -818,6 +850,13 @@ class Dispatch_control_response_msg : public ::google::protobuf::Message /* @@pr
   ::google::protobuf::int32 dispatch_destination() const;
   void set_dispatch_destination(::google::protobuf::int32 value);
 
+  // optional .message.Dispatch_device_target_status dispatch_device_target_status = 8;
+  bool has_dispatch_device_target_status() const;
+  void clear_dispatch_device_target_status();
+  static const int kDispatchDeviceTargetStatusFieldNumber = 8;
+  ::message::Dispatch_device_target_status dispatch_device_target_status() const;
+  void set_dispatch_device_target_status(::message::Dispatch_device_target_status value);
+
   // optional .message.Dispatch_task_type dispatch_task_type = 3;
   bool has_dispatch_task_type() const;
   void clear_dispatch_task_type();
@@ -848,6 +887,8 @@ class Dispatch_control_response_msg : public ::google::protobuf::Message /* @@pr
   void clear_has_dispatch_destination();
   void set_has_error_manager();
   void clear_has_error_manager();
+  void set_has_dispatch_device_target_status();
+  void clear_has_dispatch_device_target_status();
 
   // helper for ByteSizeLong()
   size_t RequiredFieldsByteSizeFallback() const;
@@ -860,6 +901,7 @@ class Dispatch_control_response_msg : public ::google::protobuf::Message /* @@pr
   ::message::Error_manager* error_manager_;
   ::google::protobuf::int32 dispatch_source_;
   ::google::protobuf::int32 dispatch_destination_;
+  int dispatch_device_target_status_;
   int dispatch_task_type_;
   int dispatch_device_type_;
   friend struct ::protobuf_dispatch_5fcontrol_2eproto::TableStruct;
@@ -1471,13 +1513,13 @@ inline void Dispatch_control_request_msg::set_allocated_command_key(::std::strin
 
 // required .message.Dispatch_task_type dispatch_task_type = 3;
 inline bool Dispatch_control_request_msg::has_dispatch_task_type() const {
-  return (_has_bits_[0] & 0x00000020u) != 0;
+  return (_has_bits_[0] & 0x00000040u) != 0;
 }
 inline void Dispatch_control_request_msg::set_has_dispatch_task_type() {
-  _has_bits_[0] |= 0x00000020u;
+  _has_bits_[0] |= 0x00000040u;
 }
 inline void Dispatch_control_request_msg::clear_has_dispatch_task_type() {
-  _has_bits_[0] &= ~0x00000020u;
+  _has_bits_[0] &= ~0x00000040u;
 }
 inline void Dispatch_control_request_msg::clear_dispatch_task_type() {
   dispatch_task_type_ = 101;
@@ -1496,13 +1538,13 @@ inline void Dispatch_control_request_msg::set_dispatch_task_type(::message::Disp
 
 // optional .message.Dispatch_device_type dispatch_device_type = 4;
 inline bool Dispatch_control_request_msg::has_dispatch_device_type() const {
-  return (_has_bits_[0] & 0x00000040u) != 0;
+  return (_has_bits_[0] & 0x00000080u) != 0;
 }
 inline void Dispatch_control_request_msg::set_has_dispatch_device_type() {
-  _has_bits_[0] |= 0x00000040u;
+  _has_bits_[0] |= 0x00000080u;
 }
 inline void Dispatch_control_request_msg::clear_has_dispatch_device_type() {
-  _has_bits_[0] &= ~0x00000040u;
+  _has_bits_[0] &= ~0x00000080u;
 }
 inline void Dispatch_control_request_msg::clear_dispatch_device_type() {
   dispatch_device_type_ = 101;
@@ -1617,6 +1659,31 @@ inline void Dispatch_control_request_msg::set_allocated_error_manager(::message:
   // @@protoc_insertion_point(field_set_allocated:message.Dispatch_control_request_msg.error_manager)
 }
 
+// optional .message.Dispatch_device_target_status dispatch_device_target_status = 8;
+inline bool Dispatch_control_request_msg::has_dispatch_device_target_status() const {
+  return (_has_bits_[0] & 0x00000020u) != 0;
+}
+inline void Dispatch_control_request_msg::set_has_dispatch_device_target_status() {
+  _has_bits_[0] |= 0x00000020u;
+}
+inline void Dispatch_control_request_msg::clear_has_dispatch_device_target_status() {
+  _has_bits_[0] &= ~0x00000020u;
+}
+inline void Dispatch_control_request_msg::clear_dispatch_device_target_status() {
+  dispatch_device_target_status_ = 0;
+  clear_has_dispatch_device_target_status();
+}
+inline ::message::Dispatch_device_target_status Dispatch_control_request_msg::dispatch_device_target_status() const {
+  // @@protoc_insertion_point(field_get:message.Dispatch_control_request_msg.dispatch_device_target_status)
+  return static_cast< ::message::Dispatch_device_target_status >(dispatch_device_target_status_);
+}
+inline void Dispatch_control_request_msg::set_dispatch_device_target_status(::message::Dispatch_device_target_status value) {
+  assert(::message::Dispatch_device_target_status_IsValid(value));
+  set_has_dispatch_device_target_status();
+  dispatch_device_target_status_ = value;
+  // @@protoc_insertion_point(field_set:message.Dispatch_control_request_msg.dispatch_device_target_status)
+}
+
 // -------------------------------------------------------------------
 
 // Dispatch_control_response_msg
@@ -1736,13 +1803,13 @@ inline void Dispatch_control_response_msg::set_allocated_command_key(::std::stri
 
 // optional .message.Dispatch_task_type dispatch_task_type = 3;
 inline bool Dispatch_control_response_msg::has_dispatch_task_type() const {
-  return (_has_bits_[0] & 0x00000020u) != 0;
+  return (_has_bits_[0] & 0x00000040u) != 0;
 }
 inline void Dispatch_control_response_msg::set_has_dispatch_task_type() {
-  _has_bits_[0] |= 0x00000020u;
+  _has_bits_[0] |= 0x00000040u;
 }
 inline void Dispatch_control_response_msg::clear_has_dispatch_task_type() {
-  _has_bits_[0] &= ~0x00000020u;
+  _has_bits_[0] &= ~0x00000040u;
 }
 inline void Dispatch_control_response_msg::clear_dispatch_task_type() {
   dispatch_task_type_ = 101;
@@ -1761,13 +1828,13 @@ inline void Dispatch_control_response_msg::set_dispatch_task_type(::message::Dis
 
 // optional .message.Dispatch_device_type dispatch_device_type = 4;
 inline bool Dispatch_control_response_msg::has_dispatch_device_type() const {
-  return (_has_bits_[0] & 0x00000040u) != 0;
+  return (_has_bits_[0] & 0x00000080u) != 0;
 }
 inline void Dispatch_control_response_msg::set_has_dispatch_device_type() {
-  _has_bits_[0] |= 0x00000040u;
+  _has_bits_[0] |= 0x00000080u;
 }
 inline void Dispatch_control_response_msg::clear_has_dispatch_device_type() {
-  _has_bits_[0] &= ~0x00000040u;
+  _has_bits_[0] &= ~0x00000080u;
 }
 inline void Dispatch_control_response_msg::clear_dispatch_device_type() {
   dispatch_device_type_ = 101;
@@ -1882,6 +1949,31 @@ inline void Dispatch_control_response_msg::set_allocated_error_manager(::message
   // @@protoc_insertion_point(field_set_allocated:message.Dispatch_control_response_msg.error_manager)
 }
 
+// optional .message.Dispatch_device_target_status dispatch_device_target_status = 8;
+inline bool Dispatch_control_response_msg::has_dispatch_device_target_status() const {
+  return (_has_bits_[0] & 0x00000020u) != 0;
+}
+inline void Dispatch_control_response_msg::set_has_dispatch_device_target_status() {
+  _has_bits_[0] |= 0x00000020u;
+}
+inline void Dispatch_control_response_msg::clear_has_dispatch_device_target_status() {
+  _has_bits_[0] &= ~0x00000020u;
+}
+inline void Dispatch_control_response_msg::clear_dispatch_device_target_status() {
+  dispatch_device_target_status_ = 0;
+  clear_has_dispatch_device_target_status();
+}
+inline ::message::Dispatch_device_target_status Dispatch_control_response_msg::dispatch_device_target_status() const {
+  // @@protoc_insertion_point(field_get:message.Dispatch_control_response_msg.dispatch_device_target_status)
+  return static_cast< ::message::Dispatch_device_target_status >(dispatch_device_target_status_);
+}
+inline void Dispatch_control_response_msg::set_dispatch_device_target_status(::message::Dispatch_device_target_status value) {
+  assert(::message::Dispatch_device_target_status_IsValid(value));
+  set_has_dispatch_device_target_status();
+  dispatch_device_target_status_ = value;
+  // @@protoc_insertion_point(field_set:message.Dispatch_control_response_msg.dispatch_device_target_status)
+}
+
 #ifdef __GNUC__
   #pragma GCC diagnostic pop
 #endif  // __GNUC__
@@ -1909,6 +2001,11 @@ template <>
 inline const EnumDescriptor* GetEnumDescriptor< ::message::Dispatch_device_type>() {
   return ::message::Dispatch_device_type_descriptor();
 }
+template <> struct is_proto_enum< ::message::Dispatch_device_target_status> : ::google::protobuf::internal::true_type {};
+template <>
+inline const EnumDescriptor* GetEnumDescriptor< ::message::Dispatch_device_target_status>() {
+  return ::message::Dispatch_device_target_status_descriptor();
+}
 
 }  // namespace protobuf
 }  // namespace google

+ 13 - 1
message/dispatch_control.proto

@@ -68,6 +68,15 @@ enum Dispatch_device_type
     PASSAGEWAY_7                            = 307;      //7号出口(在右侧电梯井, 只能取车)
 }
 
+//调度设备的目标状态, 设备完成 调度控制的任务请求 之后 将设备状态改为这个
+enum Dispatch_device_target_status
+{
+    E_UNKNOW               	= 0;    //未知
+    E_IDLE                  = 1;    //空闲
+    E_BUSY					= 2; 	//工作正忙
+    E_READY               	= 3;    //准备就绪
+    E_WAIT               	= 4;    //等待
+}
 
 //调度总规划的请求(用于启动整个调度算法)(调度管理->调度算法)
 message Dispatch_plan_request_msg
@@ -107,7 +116,8 @@ message Dispatch_control_request_msg
     optional int32                      dispatch_destination=6;          //调度的终点,目的地(一般必须写, 特殊指令可以不写)
 
     optional Error_manager              error_manager = 7;               //错误码,也是任务的完成结果(如果为0,则表示成功完成任务,非0则任务失败)
-    //发送请求的错误码只有在 DISPATCH_CANCEL 任务异常取消的时候有效, 调度模块会把这个错误反馈给总控..
+
+    optional Dispatch_device_target_status  dispatch_device_target_status = 8;  //调度设备的目标状态
 }
 
 //调度控制的任务答复(调度管理->调度算法)
@@ -122,6 +132,8 @@ message Dispatch_control_response_msg
     optional int32                      dispatch_destination=6;          //调度的终DISPATCH_FINISH点,目的地(必写,如果不写 任务就不会执行)
 
     optional Error_manager              error_manager = 7;               //错误码,也是任务的完成结果(如果为0,则表示成功完成任务,非0则任务失败)
+
+    optional Dispatch_device_target_status  dispatch_device_target_status = 8;  //调度设备的目标状态
 }
 
 

+ 28 - 26
message/message_base.pb.cc

@@ -387,36 +387,37 @@ void AddDescriptorsImpl() {
       "\n\035eDispatch_control_request_msg\020\342\001\022#\n\036eD"
       "ispatch_control_response_msg\020\343\001\022!\n\034eDisp"
       "atch_manager_status_msg\020\352\001\022\037\n\032eDispatch_"
-      "manager_data_msg\020\353\001*\202\001\n\014Communicator\022\n\n\006"
+      "manager_data_msg\020\353\001*\242\001\n\014Communicator\022\n\n\006"
       "eEmpty\020\000\022\t\n\005eMain\020\001\022\016\n\teTerminor\020\200\002\022\017\n\ne"
       "Parkspace\020\200\004\022\016\n\teMeasurer\020\200\006\022\032\n\025eMeasure"
-      "r_sift_server\020\201\006\022\016\n\teDispatch\020\200\010**\n\014Proc"
-      "ess_type\022\014\n\010eStoring\020\001\022\014\n\010ePicking\020\002*e\n\013"
-      "Error_level\022\n\n\006NORMAL\020\000\022\024\n\020NEGLIGIBLE_ER"
-      "ROR\020\001\022\017\n\013MINOR_ERROR\020\002\022\017\n\013MAJOR_ERROR\020\003\022"
-      "\022\n\016CRITICAL_ERROR\020\004*\207\001\n\020Parkspace_status"
-      "\022\024\n\020eParkspace_empty\020\000\022\027\n\023eParkspace_occ"
-      "upied\020\001\022\027\n\023eParkspace_reserved\020\002\022\025\n\021ePar"
-      "kspace_locked\020\003\022\024\n\020eParkspace_error\020\004*(\n"
-      "\tDirection\022\014\n\010eForward\020\001\022\r\n\teBackward\020\002*"
-      "[\n\016Parkspace_path\022\020\n\014OPTIMAL_PATH\020\001\022\r\n\tL"
-      "EFT_PATH\020\002\022\016\n\nRIGHT_PATH\020\003\022\030\n\024TEMPORARY_"
-      "CACHE_PATH\020\004*R\n\016Parkspace_type\022\024\n\020MIN_PA"
-      "RKINGSPACE\020\001\022\024\n\020MID_PARKINGSPACE\020\002\022\024\n\020BI"
-      "G_PARKINGSPACE\020\003*\335\002\n\tStep_type\022\017\n\013eAlloc"
-      "_step\020\000\022\021\n\reMeasure_step\020\001\022\021\n\reCompare_s"
-      "tep\020\002\022\022\n\016eDispatch_step\020\003\022\021\n\reConfirm_st"
-      "ep\020\004\022\020\n\014eSearch_step\020\005\022\016\n\neWait_step\020\006\022\021"
-      "\n\reRelease_step\020\007\022\r\n\teComplete\020\010\022\025\n\021eBac"
-      "kConfirm_step\020\t\022\026\n\022eBack_compare_step\020\n\022"
-      "\025\n\021eBackMeasure_step\020\013\022\023\n\017eBackAlloc_ste"
-      "p\020\014\022\022\n\016eBackWait_step\020\r\022\026\n\022eBackDispatch"
-      "_step\020\016\022\024\n\020eBackSearch_step\020\017\022\021\n\reBackCo"
-      "mplete\020\020*C\n\nStep_statu\022\014\n\010eWaiting\020\000\022\014\n\010"
-      "eWorking\020\001\022\n\n\006eError\020\002\022\r\n\teFinished\020\003"
+      "r_sift_server\020\201\006\022\026\n\021eDispatch_mamager\020\200\010"
+      "\022\026\n\021eDispatch_control\020\201\010**\n\014Process_type"
+      "\022\014\n\010eStoring\020\001\022\014\n\010ePicking\020\002*e\n\013Error_le"
+      "vel\022\n\n\006NORMAL\020\000\022\024\n\020NEGLIGIBLE_ERROR\020\001\022\017\n"
+      "\013MINOR_ERROR\020\002\022\017\n\013MAJOR_ERROR\020\003\022\022\n\016CRITI"
+      "CAL_ERROR\020\004*\207\001\n\020Parkspace_status\022\024\n\020ePar"
+      "kspace_empty\020\000\022\027\n\023eParkspace_occupied\020\001\022"
+      "\027\n\023eParkspace_reserved\020\002\022\025\n\021eParkspace_l"
+      "ocked\020\003\022\024\n\020eParkspace_error\020\004*(\n\tDirecti"
+      "on\022\014\n\010eForward\020\001\022\r\n\teBackward\020\002*[\n\016Parks"
+      "pace_path\022\020\n\014OPTIMAL_PATH\020\001\022\r\n\tLEFT_PATH"
+      "\020\002\022\016\n\nRIGHT_PATH\020\003\022\030\n\024TEMPORARY_CACHE_PA"
+      "TH\020\004*R\n\016Parkspace_type\022\024\n\020MIN_PARKINGSPA"
+      "CE\020\001\022\024\n\020MID_PARKINGSPACE\020\002\022\024\n\020BIG_PARKIN"
+      "GSPACE\020\003*\335\002\n\tStep_type\022\017\n\013eAlloc_step\020\000\022"
+      "\021\n\reMeasure_step\020\001\022\021\n\reCompare_step\020\002\022\022\n"
+      "\016eDispatch_step\020\003\022\021\n\reConfirm_step\020\004\022\020\n\014"
+      "eSearch_step\020\005\022\016\n\neWait_step\020\006\022\021\n\reRelea"
+      "se_step\020\007\022\r\n\teComplete\020\010\022\025\n\021eBackConfirm"
+      "_step\020\t\022\026\n\022eBack_compare_step\020\n\022\025\n\021eBack"
+      "Measure_step\020\013\022\023\n\017eBackAlloc_step\020\014\022\022\n\016e"
+      "BackWait_step\020\r\022\026\n\022eBackDispatch_step\020\016\022"
+      "\024\n\020eBackSearch_step\020\017\022\021\n\reBackComplete\020\020"
+      "*C\n\nStep_statu\022\014\n\010eWaiting\020\000\022\014\n\010eWorking"
+      "\020\001\022\n\n\006eError\020\002\022\r\n\teFinished\020\003"
   };
   ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
-      descriptor, 3397);
+      descriptor, 3429);
   ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
     "message_base.proto", &protobuf_RegisterTypes);
 }
@@ -494,6 +495,7 @@ bool Communicator_IsValid(int value) {
     case 768:
     case 769:
     case 1024:
+    case 1025:
       return true;
     default:
       return false;

+ 3 - 2
message/message_base.pb.h

@@ -146,11 +146,12 @@ enum Communicator {
   eParkspace = 512,
   eMeasurer = 768,
   eMeasurer_sift_server = 769,
-  eDispatch = 1024
+  eDispatch_mamager = 1024,
+  eDispatch_control = 1025
 };
 bool Communicator_IsValid(int value);
 const Communicator Communicator_MIN = eEmpty;
-const Communicator Communicator_MAX = eDispatch;
+const Communicator Communicator_MAX = eDispatch_control;
 const int Communicator_ARRAYSIZE = Communicator_MAX + 1;
 
 const ::google::protobuf::EnumDescriptor* Communicator_descriptor();

+ 6 - 6
system/system_executor.cpp

@@ -116,7 +116,7 @@ Error_manager System_executor::check_executer(Communication_message* p_msg)
 						message::Dispatch_response_msg t_dispatch_response_msg;
 						t_dispatch_response_msg.mutable_base_info()->set_msg_type(message::Message_type::eDispatch_response_msg);
 						t_dispatch_response_msg.mutable_base_info()->set_timeout_ms(5000);
-						t_dispatch_response_msg.mutable_base_info()->set_sender(message::Communicator::eDispatch);
+						t_dispatch_response_msg.mutable_base_info()->set_sender(message::Communicator::eDispatch_mamager);
 						t_dispatch_response_msg.mutable_base_info()->set_receiver(message::Communicator::eMain);
 
 						t_dispatch_response_msg.set_command_key(t_dispatch_request_msg.command_key());
@@ -271,7 +271,7 @@ Error_manager System_executor::encapsulate_send_status()
 	message::Dispatch_terminal_status_msg t_dispatch_terminal_status_msg;
 	t_dispatch_terminal_status_msg.mutable_base_info()->set_msg_type(message::Message_type::eDispatch_status_msg);
 	t_dispatch_terminal_status_msg.mutable_base_info()->set_timeout_ms(5000);
-	t_dispatch_terminal_status_msg.mutable_base_info()->set_sender(message::Communicator::eDispatch);
+	t_dispatch_terminal_status_msg.mutable_base_info()->set_sender(message::Communicator::eDispatch_mamager);
 	t_dispatch_terminal_status_msg.mutable_base_info()->set_receiver(message::Communicator::eMain);
 	t_dispatch_terminal_status_msg.set_terminal_id(t_dispatch_id*2+0);
 	t_dispatch_terminal_status_msg.set_terminal_status(message::Terminal_status::E_TERMINAL_READY);
@@ -281,7 +281,7 @@ Error_manager System_executor::encapsulate_send_status()
 
 	t_dispatch_terminal_status_msg.mutable_base_info()->set_msg_type(message::Message_type::eDispatch_status_msg);
 	t_dispatch_terminal_status_msg.mutable_base_info()->set_timeout_ms(5000);
-	t_dispatch_terminal_status_msg.mutable_base_info()->set_sender(message::Communicator::eDispatch);
+	t_dispatch_terminal_status_msg.mutable_base_info()->set_sender(message::Communicator::eDispatch_mamager);
 	t_dispatch_terminal_status_msg.mutable_base_info()->set_receiver(message::Communicator::eMain);
 	t_dispatch_terminal_status_msg.set_terminal_id(t_dispatch_id*2+0);
 	t_dispatch_terminal_status_msg.set_terminal_status(message::Terminal_status::E_TERMINAL_READY);
@@ -291,7 +291,7 @@ Error_manager System_executor::encapsulate_send_status()
 
 	t_dispatch_terminal_status_msg.mutable_base_info()->set_msg_type(message::Message_type::eDispatch_status_msg);
 	t_dispatch_terminal_status_msg.mutable_base_info()->set_timeout_ms(5000);
-	t_dispatch_terminal_status_msg.mutable_base_info()->set_sender(message::Communicator::eDispatch);
+	t_dispatch_terminal_status_msg.mutable_base_info()->set_sender(message::Communicator::eDispatch_mamager);
 	t_dispatch_terminal_status_msg.mutable_base_info()->set_receiver(message::Communicator::eMain);
 	t_dispatch_terminal_status_msg.set_terminal_id(t_dispatch_id*2+1);
 	t_dispatch_terminal_status_msg.set_terminal_status(message::Terminal_status::E_TERMINAL_READY);
@@ -301,7 +301,7 @@ Error_manager System_executor::encapsulate_send_status()
 
 	t_dispatch_terminal_status_msg.mutable_base_info()->set_msg_type(message::Message_type::eDispatch_status_msg);
 	t_dispatch_terminal_status_msg.mutable_base_info()->set_timeout_ms(5000);
-	t_dispatch_terminal_status_msg.mutable_base_info()->set_sender(message::Communicator::eDispatch);
+	t_dispatch_terminal_status_msg.mutable_base_info()->set_sender(message::Communicator::eDispatch_mamager);
 	t_dispatch_terminal_status_msg.mutable_base_info()->set_receiver(message::Communicator::eMain);
 	t_dispatch_terminal_status_msg.set_terminal_id(t_dispatch_id*2+1);
 	t_dispatch_terminal_status_msg.set_terminal_status(message::Terminal_status::E_TERMINAL_READY);
@@ -389,7 +389,7 @@ void System_executor::execute_for_dispatch(std::string command_key, Dispatch_man
 	message::Dispatch_response_msg t_dispatch_response_msg;
 	t_dispatch_response_msg.mutable_base_info()->set_msg_type(message::Message_type::eDispatch_response_msg);
 	t_dispatch_response_msg.mutable_base_info()->set_timeout_ms(5000);
-	t_dispatch_response_msg.mutable_base_info()->set_sender(message::Communicator::eDispatch);
+	t_dispatch_response_msg.mutable_base_info()->set_sender(message::Communicator::eDispatch_mamager);
 	t_dispatch_response_msg.mutable_base_info()->set_receiver(message::Communicator::eMain);
 
 	t_dispatch_response_msg.set_command_key(command_key);