From 35b18c3e981e131ee013975b692443b9849c131f Mon Sep 17 00:00:00 2001 From: wyc <1104749580@qq.com> Date: Tue, 28 Jul 2026 14:51:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/config.json | 22 +++++++++++++------ .../{BaseStation.cpp => Base_Station.cpp} | 16 +++++++------- .../{BaseStation.h => Base_Station.h} | 2 +- module/Local_Server/Data_Source/Database.cpp | 2 +- module/Local_Server/Data_Source/Database.h | 14 ++++++------ module/Local_Server/server/Config.cpp | 12 ++++++++++ module/Local_Server/server/Config.h | 5 +++++ 7 files changed, 49 insertions(+), 24 deletions(-) rename module/Local_Server/Data_Source/{BaseStation.cpp => Base_Station.cpp} (81%) rename module/Local_Server/Data_Source/{BaseStation.h => Base_Station.h} (96%) diff --git a/config/config.json b/config/config.json index 413eda8..139b948 100644 --- a/config/config.json +++ b/config/config.json @@ -94,13 +94,14 @@ "tile_display_maximum_level": 19 }, "camera": { - "longitude": 121.599586, - "latitude": 37.221651, - "height": 298108.121570, - "heading": 360.000000, - "pitch": -90.000000, - "roll": 0.000000 - } + "longitude": 122.014707, + "latitude": 35.714108, + "height": 241660.031820, + "heading": 347.582854, + "pitch": -54.917211, + "roll": 359.999884 + }, + "baseStationFlyToHeightOffsetMeters": 8000.000000 }, "map_models": { "aircraft_model": { @@ -611,6 +612,13 @@ "terrain_maximum_level": 15, "terrain_cache_tiles": 128, "terrain_occlusion_enabled": false, + "surface_navigation_reference_visible": true, + "view_axes_visible": true, + "performance_panel_x": 12.000000, + "performance_panel_y": 92.000000, + "view_axes_panel_x": 3.000000, + "view_axes_panel_y": 337.000000, + "view_axes_panel_size": 184.000000, "occlusion_sample_spacing_meters": 250.000000, "occlusion_clearance_margin_meters": 10.000000 } diff --git a/module/Local_Server/Data_Source/BaseStation.cpp b/module/Local_Server/Data_Source/Base_Station.cpp similarity index 81% rename from module/Local_Server/Data_Source/BaseStation.cpp rename to module/Local_Server/Data_Source/Base_Station.cpp index 38ffed3..d7fb166 100644 --- a/module/Local_Server/Data_Source/BaseStation.cpp +++ b/module/Local_Server/Data_Source/Base_Station.cpp @@ -1,38 +1,38 @@ -#include "BaseStation.h" +#include "Base_Station.h" namespace SSR { struct HULC_Status_Message; } -double BaseStation::theoretical_detection_range_meters(double base_height_meters, +double Base_Station::theoretical_detection_range_meters(double base_height_meters, double target_height_meters) { return static_cast(SSR::CPR::radio_line_of_sight_range_meters(base_height_meters, target_height_meters)); } -std::optional BaseStation::get_pos() { +std::optional Base_Station::get_pos() { std::lock_guard g(mtx); if (!hulc.GPS_has_valid_fix()) { return std::nullopt; } return SSR::Position_3D{hulc.get_latitude(), hulc.get_longitude(), static_cast(hulc.Alt)}; } -double BaseStation::get_height() { +double Base_Station::get_height() { std::lock_guard g(mtx); return hulc.Alt; } -bool BaseStation::has_valid_position() { +bool Base_Station::has_valid_position() { std::lock_guard g(mtx); return hulc.GPS_has_valid_fix(); } -void BaseStation::set_msg(const SSR::HULC_Status_Message &msg) { +void Base_Station::set_msg(const SSR::HULC_Status_Message &msg) { std::lock_guard g(mtx); hulc = msg; if (handle_when_updated) handle_when_updated(msg); } -std::string BaseStation::to_string() { +std::string Base_Station::to_string() { std::lock_guard g(mtx); return "BaseStation:[" + std::to_string(hulc.get_latitude()) + ", " + std::to_string(hulc.get_longitude()) + "]"; } -Psc::JSON BaseStation::to_Json() { +Psc::JSON Base_Station::to_Json() { std::lock_guard g(mtx); auto ret = Psc::JSON::object(); ret.append({"序列号", hulc.SerNum}); diff --git a/module/Local_Server/Data_Source/BaseStation.h b/module/Local_Server/Data_Source/Base_Station.h similarity index 96% rename from module/Local_Server/Data_Source/BaseStation.h rename to module/Local_Server/Data_Source/Base_Station.h index 4e3900d..555e53b 100644 --- a/module/Local_Server/Data_Source/BaseStation.h +++ b/module/Local_Server/Data_Source/Base_Station.h @@ -1,6 +1,6 @@ #pragma once #include "global.h" -class BaseStation { +class Base_Station { public: std::string to_string(); Psc::JSON to_Json(); diff --git a/module/Local_Server/Data_Source/Database.cpp b/module/Local_Server/Data_Source/Database.cpp index 3733b4d..beb751c 100644 --- a/module/Local_Server/Data_Source/Database.cpp +++ b/module/Local_Server/Data_Source/Database.cpp @@ -541,7 +541,7 @@ void database_server(Global *g) { ret = db->base_station.to_Json(); auto target_height = g->mode_acs.adsb_theoretical_target_altitude_meters.load(); - auto range = BaseStation::theoretical_detection_range_meters(db->alt, + auto range = Base_Station::theoretical_detection_range_meters(db->alt, target_height); ret.append({"latitude", db->lat}); ret.append({"longitude", db->lon}); diff --git a/module/Local_Server/Data_Source/Database.h b/module/Local_Server/Data_Source/Database.h index 54ae34e..2072adc 100644 --- a/module/Local_Server/Data_Source/Database.h +++ b/module/Local_Server/Data_Source/Database.h @@ -1,15 +1,15 @@ #pragma once -#include -#include "../Aircraft/Aircraft.h" -#include "../Aircraft/Flight_VTO.h" -#include "../External_Database/export.h" -#include "BaseStation.h" -#include "Local_Server/server/With_Loop_Coro.h" #include #include #include +#include #include #include +#include "../Aircraft/Aircraft.h" +#include "../Aircraft/Flight_VTO.h" +#include "../External_Database/export.h" +#include "Base_Station.h" +#include "Local_Server/server/With_Loop_Coro.h" template < typename Key_Type, typename Value_Type, @@ -153,7 +153,7 @@ public: std::shared_ptr create_aircraft(std::string_view icao) override; Psc::JSON get_aircraftlist(); Psc::JSON get_aircraftlist(int limit_msg_num); - BaseStation base_station; + Base_Station base_station; void delete_timeout_aircraft(); std::string get_key() override { return key; diff --git a/module/Local_Server/server/Config.cpp b/module/Local_Server/server/Config.cpp index 5e9edac..9956453 100644 --- a/module/Local_Server/server/Config.cpp +++ b/module/Local_Server/server/Config.cpp @@ -373,6 +373,11 @@ void Cesium_Graphics_Config::from_base_json(const Psc::JSON* that_json) { terrain_occlusion_enabled = read_optional_bool_field(that_json, "terrain_occlusion_enabled", terrain_occlusion_enabled); surface_navigation_reference_visible = read_optional_bool_field(that_json, "surface_navigation_reference_visible", surface_navigation_reference_visible); view_axes_visible = read_optional_bool_field(that_json, "view_axes_visible", view_axes_visible); + performance_panel_x = std::max(0.0, read_optional_double_field(that_json, "performance_panel_x", performance_panel_x)); + performance_panel_y = std::max(0.0, read_optional_double_field(that_json, "performance_panel_y", performance_panel_y)); + view_axes_panel_x = read_optional_double_field(that_json, "view_axes_panel_x", view_axes_panel_x); + view_axes_panel_y = std::max(0.0, read_optional_double_field(that_json, "view_axes_panel_y", view_axes_panel_y)); + view_axes_panel_size = std::clamp(read_optional_double_field(that_json, "view_axes_panel_size", view_axes_panel_size), 48.0, 240.0); occlusion_sample_spacing_meters = std::clamp(read_optional_double_field(that_json, "occlusion_sample_spacing_meters", occlusion_sample_spacing_meters), 10.0, 5000.0); occlusion_clearance_margin_meters = read_optional_double_field(that_json, "occlusion_clearance_margin_meters", occlusion_clearance_margin_meters); } @@ -397,6 +402,13 @@ Psc::JSON Cesium_Graphics_Config::to_base_json() const { ret.append({"terrain_occlusion_enabled", terrain_occlusion_enabled}); ret.append({"surface_navigation_reference_visible", surface_navigation_reference_visible}); ret.append({"view_axes_visible", view_axes_visible}); + ret.append({"performance_panel_x", performance_panel_x}); + ret.append({"performance_panel_y", performance_panel_y}); + if (view_axes_panel_x >= 0.0) { + ret.append({"view_axes_panel_x", view_axes_panel_x}); + } + ret.append({"view_axes_panel_y", view_axes_panel_y}); + ret.append({"view_axes_panel_size", view_axes_panel_size}); ret.append({"occlusion_sample_spacing_meters", occlusion_sample_spacing_meters}); ret.append({"occlusion_clearance_margin_meters", occlusion_clearance_margin_meters}); return ret; diff --git a/module/Local_Server/server/Config.h b/module/Local_Server/server/Config.h index cad7a89..b27f768 100644 --- a/module/Local_Server/server/Config.h +++ b/module/Local_Server/server/Config.h @@ -191,6 +191,11 @@ struct Cesium_Graphics_Config { bool terrain_occlusion_enabled = false; bool surface_navigation_reference_visible = false; bool view_axes_visible = false; + double performance_panel_x = 12.0; + double performance_panel_y = 92.0; + double view_axes_panel_x = -1.0; + double view_axes_panel_y = 76.0; + double view_axes_panel_size = 84.0; double occlusion_sample_spacing_meters = 250.0; double occlusion_clearance_margin_meters = 10.0; void from_base_json(const Psc::JSON* that_json);