|
@@ -98,33 +98,42 @@ void Boundary::limit(JetStream::MeasureInfo &info) {
|
|
|
|
|
|
}
|
|
|
|
|
|
-void Boundary::transMeasureInfo(JetStream::MeasureInfo &in, measure_info &out) {
|
|
|
+void Boundary::transMeasureInfo(JetStream::MeasureInfo &in, measure_buffer &out) {
|
|
|
+ measure_info info;
|
|
|
+ info.CopyFrom(out.measure_info_to_plc_forward());
|
|
|
// 如果地面雷达状态已经被修改过,直接返回
|
|
|
- if (out.ground_status() != Measure_OK) {
|
|
|
+ if (info.ground_status() != Measure_OK) {
|
|
|
+ out.mutable_measure_info_to_plc_reverse()->CopyFrom(info);
|
|
|
+ out.mutable_measure_info_to_terminal()->CopyFrom(info);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
// 设备状态
|
|
|
if (in.border_display() != Range_status::Range_correct || in.border_plc() != Range_status::Range_correct) {
|
|
|
- out.set_ground_status((MeasureStatu::Measure_Border));
|
|
|
+ info.set_ground_status((MeasureStatu::Measure_Border));
|
|
|
}
|
|
|
|
|
|
- out.set_cx(in.trans_x()); // 车辆中心坐标x
|
|
|
- out.set_cy(in.trans_y());
|
|
|
- out.set_theta(in.theta() * 180.0 / M_PI);
|
|
|
- out.set_length(0);
|
|
|
- out.set_width(in.width());
|
|
|
- out.set_wheelbase(in.wheelbase());
|
|
|
- out.set_front_theta(in.ftheta() * 180.0 / M_PI);
|
|
|
- out.set_border_statu(in.border_plc());
|
|
|
- out.set_is_stop(0);
|
|
|
+ info.set_cx(in.trans_x()); // 车辆中心坐标x
|
|
|
+ info.set_cy(in.trans_y());
|
|
|
+ info.set_theta(in.theta() * 180.0 / M_PI);
|
|
|
+ info.set_length(0);
|
|
|
+ info.set_width(in.width());
|
|
|
+ info.set_wheelbase(in.wheelbase());
|
|
|
+ info.set_front_theta(in.ftheta() * 180.0 / M_PI);
|
|
|
+ info.set_border_statu(in.border_plc());
|
|
|
+ info.set_is_stop(0);
|
|
|
|
|
|
if (DetectManager::iter()->carMoveStatus() == FAILED) {
|
|
|
- out.set_motion_statu(1); // 静止3秒
|
|
|
+ info.set_motion_statu(1); // 静止3秒
|
|
|
} else {
|
|
|
- out.set_motion_statu(0); // 运动
|
|
|
+ info.set_motion_statu(0); // 运动
|
|
|
}
|
|
|
- out.set_move_distance(0);
|
|
|
+ info.set_move_distance(0);
|
|
|
+
|
|
|
+ out.mutable_measure_info_to_plc_forward()->CopyFrom(info);
|
|
|
+ out.mutable_measure_info_to_plc_reverse()->CopyFrom(info);
|
|
|
+ out.mutable_measure_info_to_terminal()->CopyFrom(info);
|
|
|
+ out.mutable_measure_info_to_terminal()->set_border_statu(in.border_display());
|
|
|
}
|
|
|
|
|
|
void Boundary::transMeasureInfo(JetStream::MeasureInfo &in, TransitData::MeasureInfo &out) {
|