3D优化
This commit is contained in:
@@ -50,23 +50,73 @@ protected:
|
||||
std::mutex mtx;
|
||||
std::vector<bool> test_v;
|
||||
};
|
||||
class Data_Source_Map_Display_Data {
|
||||
public:
|
||||
Psc::Copyable_Atomic<bool> base_station_show = true;
|
||||
Psc::Copyable_Atomic<bool> aircraft_show = true;
|
||||
Psc::Copyable_Atomic<bool> constant_screen_size = true;
|
||||
std::string color = "#1677ff";
|
||||
std::string track_point_color = "#ffff00";
|
||||
std::string base_station_color = "#1677ff";
|
||||
std::uint32_t aircraft_pixel_size = 50;
|
||||
std::uint32_t base_station_pixel_size = 100;
|
||||
double aircraft_scale = 1.0;
|
||||
double base_station_scale = 1.0;
|
||||
Psc::Copyable_Atomic<bool> show_icao = true;
|
||||
Psc::Copyable_Atomic<bool> show_call_sign = false;
|
||||
Psc::Copyable_Atomic<bool> show_fly_status = false;
|
||||
PSC_USE_JSON
|
||||
};
|
||||
class Data_Source_Map_Display_Config {
|
||||
public:
|
||||
Data_Source_Map_Display_Data map2d;
|
||||
Data_Source_Map_Display_Data map3d;
|
||||
[[nodiscard]] Psc::JSON to_base_json() const {
|
||||
auto ret = Psc::JSON::object();
|
||||
ret.append({"map2d", map2d.to_base_json()});
|
||||
ret.append({"map3d", map3d.to_base_json()});
|
||||
return ret;
|
||||
}
|
||||
void from_base_json(const Psc::JSON* that_json) {
|
||||
if (that_json == nullptr || that_json->valueType != Psc::Object) {
|
||||
throw Psc::json_assign_error(std::make_error_code(std::errc::invalid_argument), "map_display");
|
||||
}
|
||||
map2d.from_base_json(that_json->get("map2d"));
|
||||
map3d.from_base_json(that_json->get("map3d"));
|
||||
}
|
||||
};
|
||||
class Data_Source_Data {
|
||||
public:
|
||||
Psc::Copyable_Atomic<bool> base_station_show{};
|
||||
Psc::Copyable_Atomic<bool> base_station_has_valid_position{};
|
||||
Psc::Copyable_Atomic<bool> aircraft_show{};
|
||||
std::string color = "#1677ff";
|
||||
int aircraft_pixel_size{};
|
||||
Data_Source_Map_Display_Config map_display;
|
||||
double lat{};
|
||||
double lon{};
|
||||
double alt{};
|
||||
Psc::Copyable_Atomic<bool> ignore_msg_time = false; // 忽略消息时间戳 如果启用 解码位置将不在判断消息自带时间戳
|
||||
Psc::Copyable_Atomic<bool> update_form_gps{};
|
||||
Psc::Copyable_Atomic<bool> show_icao = true;
|
||||
Psc::Copyable_Atomic<bool> show_call_sign = false;
|
||||
Psc::Copyable_Atomic<bool> show_fly_status = false;
|
||||
Psc::Copyable_Atomic<bool> keep_mode = true;
|
||||
PSC_USE_JSON
|
||||
[[nodiscard]] Psc::JSON to_base_json() const {
|
||||
auto ret = Psc::JSON::object();
|
||||
Ret_J(base_station_has_valid_position)
|
||||
ret.append({"map_display", map_display.to_base_json()});
|
||||
Ret_J(lat)
|
||||
Ret_J(lon)
|
||||
Ret_J(alt)
|
||||
Ret_J(ignore_msg_time)
|
||||
Ret_J(update_form_gps)
|
||||
Ret_J(keep_mode)
|
||||
return ret;
|
||||
}
|
||||
void from_base_json(const Psc::JSON* that_json) {
|
||||
Get_J(base_station_has_valid_position)
|
||||
map_display.from_base_json(that_json->get("map_display"));
|
||||
Get_J(lat)
|
||||
Get_J(lon)
|
||||
Get_J(alt)
|
||||
Get_J(ignore_msg_time)
|
||||
Get_J(update_form_gps)
|
||||
Get_J(keep_mode)
|
||||
}
|
||||
};
|
||||
class Data_Source : public std::enable_shared_from_this<Data_Source>,
|
||||
public Data_Source_Handler, public Data_Source_Data {
|
||||
|
||||
Reference in New Issue
Block a user