3D
This commit is contained in:
@@ -6,8 +6,15 @@ struct HULC_Status_Message;
|
||||
|
||||
std::optional<SSR::CPR::Position> BaseStation::get_pos() {
|
||||
std::lock_guard g(mtx);
|
||||
if (!hulc.GPS_has_valid_fix()) {
|
||||
return std::nullopt;
|
||||
}
|
||||
return SSR::CPR::Position{hulc.get_latitude(), hulc.get_longitude()};
|
||||
}
|
||||
bool BaseStation::has_valid_position() {
|
||||
std::lock_guard g(mtx);
|
||||
return hulc.GPS_has_valid_fix();
|
||||
}
|
||||
void BaseStation::set_msg(const SSR::HULC_Status_Message &msg) {
|
||||
std::lock_guard g(mtx);
|
||||
hulc = msg;
|
||||
@@ -34,9 +41,10 @@ Psc::JSON BaseStation::to_Json() {
|
||||
ret.append({"GPS设备检测到", hulc.GPS_device_detected()});
|
||||
ret.append({"GPS有效", hulc.GPS_valid()});
|
||||
ret.append({"GPS有效定位", hulc.GPS_has_valid_fix()});
|
||||
ret.append({"has_valid_position", hulc.GPS_has_valid_fix()});
|
||||
ret.append({"GPS高精度时间", hulc.GPS_high_accuracy_time()});
|
||||
ret.append({"启动以来TX队列溢出", hulc.TX_queue_overflow_since_startup()});
|
||||
ret.append({"过去一秒TX队列溢出", hulc.TX_queue_overflow_last_second()});
|
||||
ret.append({"发现过多NMEA数据", hulc.excessive_NMEA_found()});
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user