缩减代码
This commit is contained in:
@@ -233,21 +233,7 @@ void Data_Source_Handler::handle_mode_s(std::shared_ptr<SSR::Mode_S_Msg>& mode_s
|
||||
oss << "\t\tds:" << msg->source->get_key();
|
||||
oss << "\ttime:" << msg->mlat_timestamp.to_string() << std::endl;
|
||||
}
|
||||
// if (have_pos) {
|
||||
// std::cout << oss.str() << std::endl;
|
||||
pure_log("@/logs/mlat.log", oss.str());
|
||||
// }
|
||||
// if (t.size() > 3 && have_pos && icao == "78139F") {
|
||||
// size_t i = 1;
|
||||
// auto range = hex_mlat_map.equal_range(t.msg_hex());
|
||||
// // 遍历与key_to_find对应的所有元素
|
||||
// for (auto it = range.first; it != range.second; ++it) {
|
||||
// oss << "\t" << i++ << " " << it->second.msg << std::endl;
|
||||
// }
|
||||
// oss << "===================================================\n";
|
||||
// std::cout << oss.str() << std::endl;
|
||||
// pure_log("@/logs/icao/" + icao + "_mlat.log", oss.str(), true);
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -370,13 +356,13 @@ std::optional<std::string> convert_to_send_format(Data_Source_Handler* ds, const
|
||||
if (!use_status)
|
||||
return std::nullopt;
|
||||
auto data = static_cast<SSR::Msg*>(msg.get());
|
||||
if (output_format == Output_Data_Format::BIN || output_format == Output_Data_Format::BIN_ID) {
|
||||
if (output_format == Output_Data_Format::BIN) {
|
||||
send_msg = SSR::packet_to_escape_format(data->packet);
|
||||
}
|
||||
}
|
||||
else if (type == SSR::Msg::Radarcape_status) {
|
||||
auto data = static_cast<SSR::Msg*>(msg.get());
|
||||
if (output_format == Output_Data_Format::BIN || output_format == Output_Data_Format::BIN_ID) {
|
||||
if (output_format == Output_Data_Format::BIN) {
|
||||
send_msg = SSR::packet_to_escape_format(data->packet);
|
||||
}
|
||||
}
|
||||
@@ -385,21 +371,10 @@ std::optional<std::string> convert_to_send_format(Data_Source_Handler* ds, const
|
||||
return std::nullopt;
|
||||
auto data = static_cast<SSR::Mode_AC_Msg*>(msg.get());
|
||||
std::string& msg_hex = data->msg_hex;
|
||||
char signal_level = data->signal_level;
|
||||
SSR::MLAT_timestamp& mlat_timestamp = data->mlat_timestamp;
|
||||
if (output_format == Output_Data_Format::BIN) {
|
||||
// send_msg = create_Binary_Format_memory(msg_hex, signal_level,
|
||||
// &mlat_timestamp);
|
||||
send_msg = SSR::packet_to_escape_format(msg->packet);
|
||||
}
|
||||
else if (output_format == Output_Data_Format::BIN_ID) {
|
||||
// std::uint32_t id;
|
||||
// {
|
||||
// id = Global::instance()->mlat_server.id;
|
||||
// }
|
||||
// auto bin_id_packet = mode_s_msg_packet_to_server_packet(id,
|
||||
// data->packet); send_msg = packet_to_escape_format(bin_id_packet);
|
||||
}
|
||||
else if (output_format == Output_Data_Format::AVR) {
|
||||
send_msg = SSR::create_AVR_format(msg_hex);
|
||||
}
|
||||
@@ -412,7 +387,6 @@ std::optional<std::string> convert_to_send_format(Data_Source_Handler* ds, const
|
||||
std::string& icao = s_msg->icao;
|
||||
SSR::Downlink_Format& df = s_msg->df;
|
||||
std::string& msg_hex = s_msg->msg_hex;
|
||||
auto& signal_level = s_msg->signal_level;
|
||||
SSR::MLAT_timestamp& mlat_timestamp = s_msg->mlat_timestamp;
|
||||
auto aircraft = ds->get_aircraft(s_msg->icao);
|
||||
if (output_format == Output_Data_Format::SBS) {
|
||||
@@ -462,16 +436,6 @@ std::optional<std::string> convert_to_send_format(Data_Source_Handler* ds, const
|
||||
}
|
||||
if (output_format == Output_Data_Format::BIN) {
|
||||
send_msg = SSR::packet_to_escape_format(s_msg->packet);
|
||||
// send_msg = create_Binary_Format_memory(msg_hex, signal_level,
|
||||
// &mlat_timestamp);
|
||||
}
|
||||
else if (output_format == Output_Data_Format::BIN_ID) {
|
||||
// std::uint32_t id;
|
||||
// {
|
||||
// id = Global::instance()->mlat_server.id;
|
||||
// }
|
||||
// auto bin_id_packet = mode_s_msg_packet_to_server_packet(id,
|
||||
// data->packet); send_msg = packet_to_escape_format(bin_id_packet);
|
||||
}
|
||||
else if (output_format == Output_Data_Format::AVR) {
|
||||
send_msg = SSR::create_AVR_format(msg_hex);
|
||||
|
||||
Reference in New Issue
Block a user