修复问题
This commit is contained in:
@@ -104,9 +104,18 @@ Psc::JSON config_section_value(Global& global, Config_Section section) {
|
||||
case Config_Section::http_monitor: return global.http_monitor_config.to_base_json();
|
||||
case Config_Section::mlat: return global.mlat.to_base_json();
|
||||
case Config_Section::web_server: return global.web_server_config.to_base_json();
|
||||
case Config_Section::map_resources: return global.map_resources_config.to_base_json();
|
||||
case Config_Section::map_view: return global.map_view_config.to_base_json();
|
||||
case Config_Section::map_models: return global.map_model_config.to_base_json();
|
||||
case Config_Section::map_resources:
|
||||
return global.map_resources_config.read([](const auto& value) {
|
||||
return value.to_base_json();
|
||||
});
|
||||
case Config_Section::map_view:
|
||||
return global.map_view_config.read([](const auto& value) {
|
||||
return value.to_base_json();
|
||||
});
|
||||
case Config_Section::map_models:
|
||||
return global.map_model_config.read([](const auto& value) {
|
||||
return value.to_base_json();
|
||||
});
|
||||
case Config_Section::device: return global.device_config.to_base_json();
|
||||
case Config_Section::mode_acs: return global.mode_acs.to_base_json();
|
||||
case Config_Section::log: return global.log_config.to_base_json();
|
||||
@@ -469,25 +478,25 @@ void Cesium_Graphics_Config::from_base_json(const Psc::JSON* that_json, bool not
|
||||
return;
|
||||
if (that_json->valueType != Psc::Object)
|
||||
throw Psc::json_assign_error(std::make_error_code(std::errc::invalid_argument), "cesium_graphics");
|
||||
auto value = settings.snapshot();
|
||||
value.from_base_json(that_json, not_exist_use_default_value);
|
||||
value.target_frame_rate = std::clamp(value.target_frame_rate, 1u, 120u);
|
||||
value.resolution_scale = std::clamp(value.resolution_scale, 0.2, 1.5);
|
||||
value.msaa_samples = std::clamp(value.msaa_samples, 1u, 8u);
|
||||
value.maximum_screen_space_error = std::clamp(value.maximum_screen_space_error, 1u, 16u);
|
||||
value.terrain_maximum_level = std::clamp(value.terrain_maximum_level, 0u, 24u);
|
||||
value.terrain_cache_tiles = std::clamp(value.terrain_cache_tiles, 16u, 2048u);
|
||||
value.performance_panel_x = std::max(0.0, value.performance_panel_x);
|
||||
value.performance_panel_y = std::max(0.0, value.performance_panel_y);
|
||||
value.view_axes_panel_y = std::max(0.0, value.view_axes_panel_y);
|
||||
value.view_axes_panel_size = std::clamp(value.view_axes_panel_size, 48.0, 240.0);
|
||||
value.occlusion_sample_spacing_meters = std::clamp(value.occlusion_sample_spacing_meters, 10.0, 5000.0);
|
||||
settings.write([&](auto& target) {
|
||||
target = value;
|
||||
settings.write([&](auto& value) {
|
||||
value.from_base_json(that_json, not_exist_use_default_value);
|
||||
value.target_frame_rate = std::clamp(value.target_frame_rate, 1u, 120u);
|
||||
value.resolution_scale = std::clamp(value.resolution_scale, 0.2, 1.5);
|
||||
value.msaa_samples = std::clamp(value.msaa_samples, 1u, 8u);
|
||||
value.maximum_screen_space_error = std::clamp(value.maximum_screen_space_error, 1u, 16u);
|
||||
value.terrain_maximum_level = std::clamp(value.terrain_maximum_level, 0u, 24u);
|
||||
value.terrain_cache_tiles = std::clamp(value.terrain_cache_tiles, 16u, 2048u);
|
||||
value.performance_panel_x = std::max(0.0, value.performance_panel_x);
|
||||
value.performance_panel_y = std::max(0.0, value.performance_panel_y);
|
||||
value.view_axes_panel_y = std::max(0.0, value.view_axes_panel_y);
|
||||
value.view_axes_panel_size = std::clamp(value.view_axes_panel_size, 48.0, 240.0);
|
||||
value.occlusion_sample_spacing_meters = std::clamp(value.occlusion_sample_spacing_meters, 10.0, 5000.0);
|
||||
});
|
||||
}
|
||||
Psc::JSON Cesium_Graphics_Config::to_base_json() const {
|
||||
return settings.snapshot().to_base_json();
|
||||
return settings.read([](const auto& value) {
|
||||
return value.to_base_json();
|
||||
});
|
||||
}
|
||||
Map_Model_Item_Config::Map_Model_Item_Config(std::string url) : url(std::move(url)) {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user