huli пре 4 година
родитељ
комит
8f945e373e
4 измењених фајлова са 250 додато и 85 уклоњено
  1. 3 3
      dispatch/carrier.h
  2. 183 18
      dispatch/dispatch_communication.cpp
  3. 60 62
      dispatch/dispatch_communication.h
  4. 4 2
      message/message_base.proto

+ 3 - 3
dispatch/carrier.h

@@ -84,9 +84,9 @@ protected://member variable
 	float 								m_actual_y2;				//搬运器坐标y2轴, 小跑车控制纵向移动(后轮抓杆)
 	Clamp_motion						m_actual_clamp_motion1;		//小跑车夹车杆. 0=无动作,1=夹紧,2=松开
 	Clamp_motion						m_actual_clamp_motion2;		//小跑车夹车杆. 0=无动作,1=夹紧,2=松开
-	Small_sports_car_motion				m_actual_small_sports_car_motion;	//小跑车的位置,是否在中跑车上面
-	Joint_motion						m_actual_joint_motion_x1;		//电梯与X轴的横向轨道对接,0=无动作,
-	Joint_motion						m_actual_joint_motion_x2;		//电梯与X轴的横向轨道对接,0=无动作,
+	Small_sports_car_motion				m_actual_small_sports_car_motion;	//小跑车的位置,是否在中跑车上面, 0=无动作,1=出发到位,2=返回到位
+	Joint_motion						m_actual_joint_motion_x1;		//电梯与X轴的横向轨道对接,0=无动作,1=伸出到位,2=收回到位
+	Joint_motion						m_actual_joint_motion_x2;		//电梯与X轴的横向轨道对接,0=无动作,1=伸出到位,2=收回到位
 	//搬运器设备的错误码
 	unsigned char						m_actual_error_code[50];	//搬运器设备的故障信息位
 	unsigned char						m_actual_warning_code[50];	//搬运器设备的警告信息位

+ 183 - 18
dispatch/dispatch_communication.cpp

@@ -30,9 +30,9 @@ Error_manager Dispatch_communication::communication_init()
 
 	t_index = 0;
 	t_variable_information_vector.clear();
-	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_reserved", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 1 });
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_reserved50", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 1 });
 	t_index += sizeof(unsigned char)*1;
-	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_reserved257_275", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 19 });
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_reserved51_69", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 19 });
 	t_index += sizeof(unsigned char)*19;
 
 	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_request_x", typeid(float).name(), t_index,sizeof(float), 1 });
@@ -45,12 +45,8 @@ Error_manager Dispatch_communication::communication_init()
 	t_index += sizeof(float)*1;
 	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_request_clamp_motion", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 1 });
 	t_index += sizeof(unsigned char)*1;
-	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_reserved293", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 1 });
-	t_index += sizeof(unsigned char)*1;
-	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_reserved294", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 1 });
-	t_index += sizeof(unsigned char)*1;
-	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_reserved295", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 1 });
-	t_index += sizeof(unsigned char)*1;
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_reserved87_89", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 3 });
+	t_index += sizeof(unsigned char)*3;
 	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_request_wheelbase", typeid(float).name(), t_index,sizeof(float), 1 });
 	t_index += sizeof(float)*1;
 	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_request_d1", typeid(float).name(), t_index,sizeof(float), 1 });
@@ -83,7 +79,7 @@ Error_manager Dispatch_communication::communication_init()
 	t_index += sizeof(unsigned char)*50;
 	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_respons_status", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 1 });
 	t_index += sizeof(unsigned char)*1;
-	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_reserved257_275", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 19 });
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_reserved51_69", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 19 });
 	t_index += sizeof(unsigned char)*19;
 
 	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_respons_x", typeid(float).name(), t_index,sizeof(float), 1 });
@@ -96,12 +92,8 @@ Error_manager Dispatch_communication::communication_init()
 	t_index += sizeof(float)*1;
 	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_respons_clamp_motion", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 1 });
 	t_index += sizeof(unsigned char)*1;
-	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_reserved293", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 1 });
-	t_index += sizeof(unsigned char)*1;
-	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_reserved294", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 1 });
-	t_index += sizeof(unsigned char)*1;
-	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_reserved295", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 1 });
-	t_index += sizeof(unsigned char)*1;
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_reserved87_89", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 3 });
+	t_index += sizeof(unsigned char)*3;
 	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_respons_wheelbase", typeid(float).name(), t_index,sizeof(float), 1 });
 	t_index += sizeof(float)*1;
 	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_respons_d1", typeid(float).name(), t_index,sizeof(float), 1 });
@@ -164,6 +156,161 @@ Error_manager Dispatch_communication::communication_init()
 	m_receive_buf_map[3] = t_snap7_buf;
 
 
+
+
+
+
+
+
+	t_index = 0;
+	t_variable_information_vector.clear();
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_reserved50", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 1 });
+	t_index += sizeof(unsigned char)*1;
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_reserved51_71", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 21 });
+	t_index += sizeof(unsigned char)*21;
+
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_request_x", typeid(float).name(), t_index,sizeof(float), 1 });
+	t_index += sizeof(float)*1;
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_request_y", typeid(float).name(), t_index,sizeof(float), 1 });
+	t_index += sizeof(float)*1;
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_request_z", typeid(float).name(), t_index,sizeof(float), 1 });
+	t_index += sizeof(float)*1;
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_request_y1", typeid(float).name(), t_index,sizeof(float), 1 });
+	t_index += sizeof(float)*1;
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_request_y2", typeid(float).name(), t_index,sizeof(float), 1 });
+	t_index += sizeof(float)*1;
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_request_clamp_motion", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 1 });
+	t_index += sizeof(unsigned char)*1;
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_request_joint_motion_x", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 1 });
+	t_index += sizeof(unsigned char)*1;
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_request_joint_motion_y", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 1 });
+	t_index += sizeof(unsigned char)*1;
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_reserved95", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 1 });
+	t_index += sizeof(unsigned char)*1;
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_request_space_id", typeid(float).name(), t_index,sizeof(float), 1 });
+	t_index += sizeof(int)*1;
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_request_floor_id", typeid(float).name(), t_index,sizeof(float), 1 });
+	t_index += sizeof(int)*1;
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_request_wheelbase", typeid(float).name(), t_index,sizeof(float), 1 });
+	t_index += sizeof(float)*1;
+
+	t_snap7_buf.init(CARRIER_REQUEST_FROM_DISPATCH_TO_PLC_DBNUMBER_1, 50, sizeof(Carrier_request_from_dispatch_to_plc_for_data), t_variable_information_vector, Snap7_buf::LOOP_COMMUNICATION);
+	m_send_buf_map[4] = t_snap7_buf;
+	t_snap7_buf.init(CARRIER_REQUEST_FROM_DISPATCH_TO_PLC_DBNUMBER_2, 50, sizeof(Carrier_request_from_dispatch_to_plc_for_data), t_variable_information_vector, Snap7_buf::NO_COMMUNICATION);
+	m_send_buf_map[5] = t_snap7_buf;
+	t_snap7_buf.init(CARRIER_REQUEST_FROM_DISPATCH_TO_PLC_DBNUMBER_3, 50, sizeof(Carrier_request_from_dispatch_to_plc_for_data), t_variable_information_vector, Snap7_buf::NO_COMMUNICATION);
+	m_send_buf_map[6] = t_snap7_buf;
+
+
+
+	t_index = 0;
+	t_variable_information_vector.clear();
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_request_key", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 50 });
+	t_index += sizeof(unsigned char)*50;
+
+	t_snap7_buf.init(CARRIER_REQUEST_FROM_DISPATCH_TO_PLC_DBNUMBER_1, 0, sizeof(Carrier_request_from_dispatch_to_plc_for_key), t_variable_information_vector, Snap7_buf::LOOP_COMMUNICATION);
+	m_send_buf_map[7] = t_snap7_buf;
+	t_snap7_buf.init(CARRIER_REQUEST_FROM_DISPATCH_TO_PLC_DBNUMBER_2, 0, sizeof(Carrier_request_from_dispatch_to_plc_for_key), t_variable_information_vector, Snap7_buf::NO_COMMUNICATION);
+	m_send_buf_map[8] = t_snap7_buf;
+	t_snap7_buf.init(CARRIER_REQUEST_FROM_DISPATCH_TO_PLC_DBNUMBER_3, 0, sizeof(Carrier_request_from_dispatch_to_plc_for_key), t_variable_information_vector, Snap7_buf::NO_COMMUNICATION);
+	m_send_buf_map[9] = t_snap7_buf;
+
+
+
+	t_index = 0;
+	t_variable_information_vector.clear();
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_respons_key", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 50 });
+	t_index += sizeof(unsigned char)*50;
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_respons_status", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 1 });
+	t_index += sizeof(unsigned char)*1;
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_reserved51_71", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 19 });
+	t_index += sizeof(unsigned char)*19;
+
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_respons_x", typeid(float).name(), t_index,sizeof(float), 1 });
+	t_index += sizeof(float)*1;
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_respons_y", typeid(float).name(), t_index,sizeof(float), 1 });
+	t_index += sizeof(float)*1;
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_respons_z", typeid(float).name(), t_index,sizeof(float), 1 });
+	t_index += sizeof(float)*1;
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_respons_y1", typeid(float).name(), t_index,sizeof(float), 1 });
+	t_index += sizeof(float)*1;
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_respons_y2", typeid(float).name(), t_index,sizeof(float), 1 });
+	t_index += sizeof(float)*1;
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_respons_clamp_motion", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 1 });
+	t_index += sizeof(unsigned char)*1;
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_respons_joint_motion_x", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 1 });
+	t_index += sizeof(unsigned char)*1;
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_respons_joint_motion_y", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 1 });
+	t_index += sizeof(unsigned char)*1;
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_reserved95", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 1 });
+	t_index += sizeof(unsigned char)*1;
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_respons_space_id", typeid(float).name(), t_index,sizeof(float), 1 });
+	t_index += sizeof(int)*1;
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_respons_floor_id", typeid(float).name(), t_index,sizeof(float), 1 });
+	t_index += sizeof(int)*1;
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_respons_wheelbase", typeid(float).name(), t_index,sizeof(float), 1 });
+	t_index += sizeof(float)*1;
+
+
+	t_snap7_buf.init(CARRIER_RESPONSE_FROM_PLC_TO_DISPATCH_DBNUMBER_1, 0, sizeof(Carrier_response_from_plc_to_dispatch), t_variable_information_vector, Snap7_buf::LOOP_COMMUNICATION);
+	m_receive_buf_map[4] = t_snap7_buf;
+	t_snap7_buf.init(CARRIER_RESPONSE_FROM_PLC_TO_DISPATCH_DBNUMBER_2, 0, sizeof(Carrier_response_from_plc_to_dispatch), t_variable_information_vector, Snap7_buf::NO_COMMUNICATION);
+	m_receive_buf_map[5] = t_snap7_buf;
+	t_snap7_buf.init(CARRIER_RESPONSE_FROM_PLC_TO_DISPATCH_DBNUMBER_3, 0, sizeof(Carrier_response_from_plc_to_dispatch), t_variable_information_vector, Snap7_buf::NO_COMMUNICATION);
+	m_receive_buf_map[6] = t_snap7_buf;
+
+
+	t_index = 0;
+	t_variable_information_vector.clear();
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_heartbeat", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 1 });
+	t_index += sizeof(unsigned char)*1;
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_safe_status", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 1 });
+	t_index += sizeof(unsigned char)*1;
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_work_status", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 1 });
+	t_index += sizeof(unsigned char)*1;
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_actual_load_status", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 1 });
+	t_index += sizeof(unsigned char)*1;
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_reserved4_37", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 34 });
+	t_index += sizeof(unsigned char)*34;
+
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_actual_x", typeid(float).name(), t_index,sizeof(float), 1 });
+	t_index += sizeof(float)*1;
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_actual_y", typeid(float).name(), t_index,sizeof(float), 1 });
+	t_index += sizeof(float)*1;
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_actual_z", typeid(float).name(), t_index,sizeof(float), 1 });
+	t_index += sizeof(float)*1;
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_actual_y1", typeid(float).name(), t_index,sizeof(float), 1 });
+	t_index += sizeof(float)*1;
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_actual_y2", typeid(float).name(), t_index,sizeof(float), 1 });
+	t_index += sizeof(float)*1;
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_actual_clamp_motion1", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 1 });
+	t_index += sizeof(unsigned char)*1;
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_actual_clamp_motion2", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 1 });
+	t_index += sizeof(unsigned char)*1;
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_actual_small_sports_car_motion", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 1 });
+	t_index += sizeof(unsigned char)*1;
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_actual_joint_motion_x1", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 1 });
+	t_index += sizeof(unsigned char)*1;
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_actual_joint_motion_x2", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 1 });
+	t_index += sizeof(unsigned char)*1;
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_reserved63_99", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 34 });
+	t_index += sizeof(unsigned char)*37;
+
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_actual_error_code", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 50 });
+	t_index += sizeof(unsigned char)*50;
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_actual_warning_code", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 50 });
+	t_index += sizeof(unsigned char)*50;
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_actual_error_description", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 256 });
+	t_index += sizeof(unsigned char)*256;
+
+	t_snap7_buf.init(CARRIER_STATUS_FROM_PLC_TO_DISPATCH_DBNUMBER_1, 0, sizeof(Carrier_status_from_plc_to_dispatch), t_variable_information_vector, Snap7_buf::LOOP_COMMUNICATION);
+	m_receive_buf_map[7] = t_snap7_buf;
+	t_snap7_buf.init(CARRIER_STATUS_FROM_PLC_TO_DISPATCH_DBNUMBER_2, 0, sizeof(Carrier_status_from_plc_to_dispatch), t_variable_information_vector, Snap7_buf::NO_COMMUNICATION);
+	m_receive_buf_map[8] = t_snap7_buf;
+	t_snap7_buf.init(CARRIER_STATUS_FROM_PLC_TO_DISPATCH_DBNUMBER_2, 0, sizeof(Carrier_status_from_plc_to_dispatch), t_variable_information_vector, Snap7_buf::NO_COMMUNICATION);
+	m_receive_buf_map[9] = t_snap7_buf;
+
+
 	return Snap7_communication_base::communication_init();
 }
 
@@ -186,8 +333,12 @@ Error_manager Dispatch_communication::updata_receive_buf()
 	memcpy(&m_catcher_status_from_plc_to_dispatch[0], m_receive_buf_map[2].mp_buf_obverse, m_receive_buf_map[2].m_size);
 	memcpy(&m_catcher_status_from_plc_to_dispatch[1], m_receive_buf_map[3].mp_buf_obverse, m_receive_buf_map[3].m_size);
 
-//	int heat = m_catcher_status_from_plc_to_dispatch[1].m_heartbeat;
-//	std::cout << " huli test :::: " << " 999999999 = " << heat << std::endl;
+	memcpy(&m_carrier_response_from_plc_to_dispatch[0], m_receive_buf_map[4].mp_buf_obverse, m_receive_buf_map[4].m_size);
+	memcpy(&m_carrier_response_from_plc_to_dispatch[1], m_receive_buf_map[5].mp_buf_obverse, m_receive_buf_map[5].m_size);
+	memcpy(&m_carrier_response_from_plc_to_dispatch[2], m_receive_buf_map[6].mp_buf_obverse, m_receive_buf_map[6].m_size);
+	memcpy(&m_carrier_status_from_plc_to_dispatch[0], m_receive_buf_map[7].mp_buf_obverse, m_receive_buf_map[7].m_size);
+	memcpy(&m_carrier_status_from_plc_to_dispatch[1], m_receive_buf_map[8].mp_buf_obverse, m_receive_buf_map[8].m_size);
+	memcpy(&m_carrier_status_from_plc_to_dispatch[2], m_receive_buf_map[9].mp_buf_obverse, m_receive_buf_map[9].m_size);
 
 	return Error_code::SUCCESS;
 }
@@ -196,7 +347,8 @@ Error_manager Dispatch_communication::updata_send_buf()
 	std::unique_lock<std::mutex> t_lock1(m_send_buf_lock);
 	std::unique_lock<std::mutex> t_lock2(m_data_lock);
 
-	m_catcher_request_from_dispatch_to_plc_for_data[1].m_reserved = 1;
+	m_catcher_request_from_dispatch_to_plc_for_data[0].m_reserved50 = 1;
+	m_catcher_request_from_dispatch_to_plc_for_data[1].m_reserved50 = 1;
 
 	memcpy(m_send_buf_map[0].mp_buf_obverse, &m_catcher_request_from_dispatch_to_plc_for_data[0], m_send_buf_map[0].m_size);
 	memcpy(m_send_buf_map[1].mp_buf_obverse, &m_catcher_request_from_dispatch_to_plc_for_data[1], m_send_buf_map[1].m_size);
@@ -204,6 +356,19 @@ Error_manager Dispatch_communication::updata_send_buf()
 	memcpy(m_send_buf_map[3].mp_buf_obverse, &m_catcher_request_from_dispatch_to_plc_for_key[1], m_send_buf_map[3].m_size);
 
 
+
+	m_carrier_request_from_dispatch_to_plc_for_data[0].m_reserved50 = 1;
+	m_carrier_request_from_dispatch_to_plc_for_data[1].m_reserved50 = 1;
+	m_carrier_request_from_dispatch_to_plc_for_data[2].m_reserved50 = 1;
+
+	memcpy(m_send_buf_map[4].mp_buf_obverse, &m_carrier_request_from_dispatch_to_plc_for_data[0], m_send_buf_map[4].m_size);
+	memcpy(m_send_buf_map[5].mp_buf_obverse, &m_carrier_request_from_dispatch_to_plc_for_data[1], m_send_buf_map[5].m_size);
+	memcpy(m_send_buf_map[6].mp_buf_obverse, &m_carrier_request_from_dispatch_to_plc_for_data[2], m_send_buf_map[6].m_size);
+	memcpy(m_send_buf_map[7].mp_buf_obverse, &m_carrier_request_from_dispatch_to_plc_for_key[0], m_send_buf_map[7].m_size);
+	memcpy(m_send_buf_map[8].mp_buf_obverse, &m_carrier_request_from_dispatch_to_plc_for_key[1], m_send_buf_map[8].m_size);
+	memcpy(m_send_buf_map[9].mp_buf_obverse, &m_carrier_request_from_dispatch_to_plc_for_key[2], m_send_buf_map[9].m_size);
+
+
 //	Dispatch_communication::Catcher_request_from_dispatch_to_plc_for_key * tp_catcher_request_from_dispatch_to_plc_for_key =
 //	& Dispatch_communication::get_instance_references().m_catcher_request_from_dispatch_to_plc_for_key[1];
 //	int k1 = tp_catcher_request_from_dispatch_to_plc_for_key->m_request_key[0];

+ 60 - 62
dispatch/dispatch_communication.h

@@ -31,17 +31,15 @@ public:
 	struct Catcher_request_from_dispatch_to_plc_for_data
 	{
 		//指令信息
-		unsigned char			m_reserved = 0;					//预留
-		unsigned char			m_reserved257_275[19] = {0};	//预留
+		unsigned char			m_reserved50 = 0;					//预留
+		unsigned char			m_reserved51_69[19] = {0};	//预留
 		// 请求的目标坐标和动作
 		float 					m_request_x = 0;				//机器人坐标x轴,
 		float 					m_request_y = 0;				//机器人坐标y轴,
 		float 					m_request_b = 0;				//机器人坐标b轴, 旋转范围80~280
 		float 					m_request_z = 0;				//机器人坐标z轴,
 		unsigned char			m_request_clamp_motion = 0;		//机器人夹车杆. 0=无动作,1=夹紧,2=松开
-		unsigned char			m_reserved293 = 0;				//预留
-		unsigned char			m_reserved294 = 0;				//预留
-		unsigned char			m_reserved295 = 0;				//预留
+		unsigned char			m_reserved87_89[3] = {0};			//预留
 		float 					m_request_wheelbase = 0;		//机器人抓车杆前后轮距.
 		float 					m_request_d1 = 0;				//机器人坐标d1轴, 机器人抓车杆纵向移动(前轮抓杆)
 		float 					m_request_d2 = 0;				//机器人坐标d2轴, 机器人抓车杆纵向移动(后轮抓杆)
@@ -63,16 +61,14 @@ public:
 		//指令信息
 		unsigned char			m_respons_key[50] = {0};		//指令key(任务唯一码), 作为通信标志位
 		unsigned char			m_respons_status = 0;			//指令完成状态, 机器人答复指令, 返回任务完成的情况
-		unsigned char			m_reserved257_275[19] = {0};	//预留
+		unsigned char			m_reserved51_69[19] = {0};	//预留
 		//请求的目标坐标和动作
 		float 					m_respons_x = 0;				//机器人坐标x轴,
 		float 					m_respons_y = 0;				//机器人坐标y轴,
 		float 					m_respons_b = 0;				//机器人坐标b轴, 旋转范围80~280
 		float 					m_respons_z = 0;				//机器人坐标z轴,
 		unsigned char			m_respons_clamp_motion = 0;		//机器人夹车杆. 0=无动作,1=夹紧,2=松开
-		unsigned char			m_reserved293 = 0;				//预留
-		unsigned char			m_reserved294 = 0;				//预留
-		unsigned char			m_reserved295 = 0;				//预留
+		unsigned char			m_reserved87_89[3] = {0};			//预留
 		float 					m_respons_wheelbase = 0;		//机器人抓车杆前后轮距.
 		float 					m_respons_d1 = 0;				//机器人坐标d1轴, 机器人抓车杆纵向移动(前轮抓杆)
 		float 					m_respons_d2 = 0;				//机器人坐标d2轴, 机器人抓车杆纵向移动(后轮抓杆)
@@ -88,7 +84,7 @@ public:
 
 		unsigned char			m_safe_status = 0;				//设备的安全状态
 		unsigned char			m_work_status = 0;				//机器人的硬件设备状态
-		unsigned char			m_actual_load_status = 0;				//机器人的负载状态, 小跑车上面是否有车.
+		unsigned char			m_actual_load_status = 0;		//机器人的负载状态, 机器人上面是否有车.
 		unsigned char			m_reserved4_37[34] = {0};		//预留
 
 		float 					m_actual_x = 0;					//机器人坐标x轴,
@@ -97,10 +93,10 @@ public:
 		float 					m_actual_z = 0;					//机器人坐标z轴,
 		float 					m_actual_d1 = 0;				//机器人坐标d1轴, 机器人抓车杆纵向移动(前轮抓杆)
 		float 					m_actual_d2 = 0;				//机器人坐标d2轴, 机器人抓车杆纵向移动(后轮抓杆)
-		unsigned char			m_actual_clamp_motion1 = 0;		//小跑车夹车杆. 0=无动作,1=夹紧,2=松开
-		unsigned char			m_actual_clamp_motion2 = 0;		//小跑车夹车杆. 0=无动作,1=夹紧,2=松开
-		unsigned char			m_actual_clamp_motion3 = 0;		//小跑车夹车杆. 0=无动作,1=夹紧,2=松开
-		unsigned char			m_actual_clamp_motion4 = 0;		//小跑车夹车杆. 0=无动作,1=夹紧,2=松开
+		unsigned char			m_actual_clamp_motion1 = 0;		//机器人夹车杆. 0=无动作,1=夹紧,2=松开
+		unsigned char			m_actual_clamp_motion2 = 0;		//机器人夹车杆. 0=无动作,1=夹紧,2=松开
+		unsigned char			m_actual_clamp_motion3 = 0;		//机器人夹车杆. 0=无动作,1=夹紧,2=松开
+		unsigned char			m_actual_clamp_motion4 = 0;		//机器人夹车杆. 0=无动作,1=夹紧,2=松开
 		unsigned char			m_reserved66_99[34] = {0};		//预留
 
 		//故障信息
@@ -121,79 +117,81 @@ public:
 	struct Carrier_request_from_dispatch_to_plc_for_data
 	{
 		//指令信息
-		unsigned char			m_reserved = 0;					//预留
-		unsigned char			m_reserved257_275[19] = {0};	//预留
-		// 请求的目标坐标和动作
-		float 					m_request_x = 0;				//机器人坐标x轴,
-		float 					m_request_y = 0;				//机器人坐标y轴,
-		float 					m_request_b = 0;				//机器人坐标b轴, 旋转范围80~280
-		float 					m_request_z = 0;				//机器人坐标z轴,
-		unsigned char			m_request_clamp_motion = 0;		//机器人夹车杆. 0=无动作,1=夹紧,2=松开
-		unsigned char			m_reserved293 = 0;				//预留
-		unsigned char			m_reserved294 = 0;				//预留
-		unsigned char			m_reserved295 = 0;				//预留
-		float 					m_request_wheelbase = 0;		//机器人抓车杆前后轮距.
-		float 					m_request_d1 = 0;				//机器人坐标d1轴, 机器人抓车杆纵向移动(前轮抓杆)
-		float 					m_request_d2 = 0;				//机器人坐标d2轴, 机器人抓车杆纵向移动(后轮抓杆)
+		unsigned char						m_reserved50 = 0;			//预留
+		unsigned char						m_reserved51_71[21] = {0};	//预留
+		//请求的目标坐标和动作
+		float 								m_request_x;				//搬运器坐标x轴, 中跑车控制横向移动
+		float 								m_request_y;				//搬运器坐标y轴, 小跑车控制纵向移动
+		float 								m_request_z;				//搬运器坐标z轴, 电梯控制上下移动
+		float 								m_request_y1;				//搬运器坐标y1轴, 小跑车控制纵向移动(前轮抓杆)
+		float 								m_request_y2;				//搬运器坐标y2轴, 小跑车控制纵向移动(后轮抓杆)
+		unsigned char						m_request_clamp_motion;		//小跑车夹车杆. 0=无动作,1=夹紧,2=松开
+		unsigned char						m_request_joint_motion_x;	//电梯与X轴的横向轨道对接,0=无动作,1=进行对接, 2=松开对接
+		unsigned char						m_request_joint_motion_y;	//小跑车与Y轴的横向轨道对接,0=无动作,1=进行对接, 2=松开对接
+		unsigned char						m_reserved95 = 0;					//预留
+		int 								m_request_space_id;			//搬运器空间位置的id.
+		int 								m_request_floor_id;			//搬运器楼层位置的id.
+		float 								m_request_wheelbase;		//搬运器小跑车的抓车杆前后轮距.
 	};
 
 	//搬运器给plc发送请求消息的指令结构体
 	struct Carrier_request_from_dispatch_to_plc_for_key
 	{
 		//指令信息
-		unsigned char			m_request_key[50] = {0};		//指令key(任务唯一码), 作为通信标志位
+		unsigned char						m_request_key[50] = {0};		//指令key(任务唯一码), 作为通信标志位
 	};
 
 	//plc给搬运器发送答复消息的DB编号
 #define CARRIER_RESPONSE_FROM_PLC_TO_DISPATCH_DBNUMBER_1		201
 #define CARRIER_RESPONSE_FROM_PLC_TO_DISPATCH_DBNUMBER_2		271
-#define CARRIER_RESPONSE_FROM_PLC_TO_DISPATCH_DBNUMBER_2		231
+#define CARRIER_RESPONSE_FROM_PLC_TO_DISPATCH_DBNUMBER_3		231
 	//plc给搬运器发送答复消息的指令结构体
 	struct Carrier_response_from_plc_to_dispatch
 	{
 		//指令信息
-		unsigned char			m_respons_key[50] = {0};		//指令key(任务唯一码), 作为通信标志位
-		unsigned char			m_respons_status = 0;			//指令完成状态, 机器人答复指令, 返回任务完成的情况
-		unsigned char			m_reserved257_275[19] = {0};	//预留
+		unsigned char						m_respons_key[50] = {0};	//指令key(任务唯一码), 作为通信标志位
+		unsigned char						m_respons_status = 0;		//指令完成状态, 机器人答复指令, 返回任务完成的情况
+		unsigned char						m_reserved51_71[21] = {0};	//预留
 		//请求的目标坐标和动作
-		float 					m_respons_x = 0;				//机器人坐标x轴,
-		float 					m_respons_y = 0;				//机器人坐标y轴,
-		float 					m_respons_b = 0;				//机器人坐标b轴, 旋转范围80~280
-		float 					m_respons_z = 0;				//机器人坐标z轴,
-		unsigned char			m_respons_clamp_motion = 0;		//机器人夹车杆. 0=无动作,1=夹紧,2=松开
-		unsigned char			m_reserved293 = 0;				//预留
-		unsigned char			m_reserved294 = 0;				//预留
-		unsigned char			m_reserved295 = 0;				//预留
-		float 					m_respons_wheelbase = 0;		//机器人抓车杆前后轮距.
-		float 					m_respons_d1 = 0;				//机器人坐标d1轴, 机器人抓车杆纵向移动(前轮抓杆)
-		float 					m_respons_d2 = 0;				//机器人坐标d2轴, 机器人抓车杆纵向移动(后轮抓杆)
+		float 								m_respons_x;				//搬运器坐标x轴, 中跑车控制横向移动
+		float 								m_respons_y;				//搬运器坐标y轴, 小跑车控制纵向移动
+		float 								m_respons_z;				//搬运器坐标z轴, 电梯控制上下移动
+		float 								m_respons_y1;				//搬运器坐标y1轴, 小跑车控制纵向移动(前轮抓杆)
+		float 								m_respons_y2;				//搬运器坐标y2轴, 小跑车控制纵向移动(后轮抓杆)
+		unsigned char						m_respons_clamp_motion;		//小跑车夹车杆. 0=无动作,1=夹紧,2=松开
+		unsigned char						m_respons_joint_motion_x;	//电梯与X轴的横向轨道对接,0=无动作,1=进行对接, 2=松开对接
+		unsigned char						m_respons_joint_motion_y;	//小跑车与Y轴的横向轨道对接,0=无动作,1=进行对接, 2=松开对接
+		unsigned char						m_reserved95 = 0;					//预留
+		int 								m_respons_space_id;			//搬运器空间位置的id.
+		int 								m_respons_floor_id;			//搬运器楼层位置的id.
+		float 								m_respons_wheelbase;		//搬运器小跑车的抓车杆前后轮距.
 	};
 
 	//plc给搬运器发送状态消息的DB编号
-#define CARRIER_STATUS_FROM_PLC_TO_DISPATCH_DBNUMBER_1		113
-#define CARRIER_STATUS_FROM_PLC_TO_DISPATCH_DBNUMBER_2		123
+#define CARRIER_STATUS_FROM_PLC_TO_DISPATCH_DBNUMBER_1		203
+#define CARRIER_STATUS_FROM_PLC_TO_DISPATCH_DBNUMBER_2		273
+#define CARRIER_STATUS_FROM_PLC_TO_DISPATCH_DBNUMBER_3		233
 	//plc给搬运器发送状态消息的指令结构体
 	struct Carrier_status_from_plc_to_dispatch
 	{
 		unsigned char			m_heartbeat = 0;				//心跳位, 0-255循环
 
 		unsigned char			m_safe_status = 0;				//设备的安全状态
-		unsigned char			m_work_status = 0;				//机器人的硬件设备状态
-		unsigned char			m_actual_load_status = 0;				//机器人的负载状态, 小跑车上面是否有车.
+		unsigned char			m_work_status = 0;				//搬运器的硬件设备状态
+		unsigned char			m_actual_load_status = 0;		//搬运器的负载状态, 小跑车上面是否有车.
 		unsigned char			m_reserved4_37[34] = {0};		//预留
 
-		float 					m_actual_x = 0;					//机器人坐标x轴,
-		float 					m_actual_y = 0;					//机器人坐标y轴,
-		float 					m_actual_b = 0;					//机器人坐标b轴, 旋转范围80~280
-		float 					m_actual_z = 0;					//机器人坐标z轴,
-		float 					m_actual_d1 = 0;				//机器人坐标d1轴, 机器人抓车杆纵向移动(前轮抓杆)
-		float 					m_actual_d2 = 0;				//机器人坐标d2轴, 机器人抓车杆纵向移动(后轮抓杆)
+		float 					m_actual_x = 0;					//搬运器坐标x轴,
+		float 					m_actual_y = 0;					//搬运器坐标y轴,
+		float 					m_actual_z = 0;					//搬运器坐标z轴,
+		float 					m_actual_y1 = 0;				//搬运器坐标y1轴, 小跑车控制纵向移动(前轮抓杆)
+		float 					m_actual_y2 = 0;				//搬运器坐标y2轴, 小跑车控制纵向移动(前轮抓杆)
 		unsigned char			m_actual_clamp_motion1 = 0;		//小跑车夹车杆. 0=无动作,1=夹紧,2=松开
 		unsigned char			m_actual_clamp_motion2 = 0;		//小跑车夹车杆. 0=无动作,1=夹紧,2=松开
-		unsigned char			m_actual_clamp_motion3 = 0;		//小跑车夹车杆. 0=无动作,1=夹紧,2=松开
-		unsigned char			m_actual_clamp_motion4 = 0;		//小跑车夹车杆. 0=无动作,1=夹紧,2=松开
-		unsigned char			m_reserved66_99[34] = {0};		//预留
-
+		unsigned char			m_actual_small_sports_car_motion = 0;		//小跑车的位置,是否在中跑车上面, 0=无动作,1=出发到位,2=返回到位
+		unsigned char			m_actual_joint_motion_x1 = 0;		//电梯与X轴的横向轨道对接,0=无动作,1=伸出到位,2=收回到位
+		unsigned char			m_actual_joint_motion_x2 = 0;		//电梯与X轴的横向轨道对接,0=无动作,1=伸出到位,2=收回到位
+		unsigned char			m_reserved63_99[37] = {0};		//预留
 		//故障信息
 		unsigned char			m_actual_error_code[50] = {0};		//搬运器错误码
 		unsigned char			m_actual_warning_code[50] = {0};	//升降机错误码
@@ -238,10 +236,10 @@ public:
 	Catcher_response_from_plc_to_dispatch				m_catcher_response_from_plc_to_dispatch[2];	//plc给抓车模块发送答复消息的指令结构体
 	Catcher_status_from_plc_to_dispatch					m_catcher_status_from_plc_to_dispatch[2];	//plc给抓车模块发送状态消息的指令结构体
 
-	Carrier_request_from_dispatch_to_plc_for_data		m_carrier_request_from_dispatch_to_plc_for_data[2];	//搬运器给plc发送请求消息的指令结构体
-	Carrier_request_from_dispatch_to_plc_for_key		m_carrier_request_from_dispatch_to_plc_for_key[2];	//搬运器给plc发送请求消息的指令结构体
-	Carrier_response_from_plc_to_dispatch				m_carrier_response_from_plc_to_dispatch[2];	//plc给搬运器发送答复消息的指令结构体
-	Carrier_status_from_plc_to_dispatch					m_carrier_status_from_plc_to_dispatch[2];	//plc给搬运器发送状态消息的指令结构体
+	Carrier_request_from_dispatch_to_plc_for_data		m_carrier_request_from_dispatch_to_plc_for_data[3];	//搬运器给plc发送请求消息的指令结构体
+	Carrier_request_from_dispatch_to_plc_for_key		m_carrier_request_from_dispatch_to_plc_for_key[3];	//搬运器给plc发送请求消息的指令结构体
+	Carrier_response_from_plc_to_dispatch				m_carrier_response_from_plc_to_dispatch[3];	//plc给搬运器发送答复消息的指令结构体
+	Carrier_status_from_plc_to_dispatch					m_carrier_status_from_plc_to_dispatch[3];	//plc给搬运器发送状态消息的指令结构体
 
 private:
 

+ 4 - 2
message/message_base.proto

@@ -69,10 +69,12 @@ enum Communicator
     eParkspace=0x0200;
     //测量单元
     eMeasurer=0x0300;
-    //测量单元
+    //测量单元的服务器
     eMeasurer_sift_server=0x0301;
     //调度机构
-    eDispatch=0x0400;
+    eDispatch_mamager=0x0400;
+    //调度机构
+    eDispatch_control=0x0401;
     //...