构建时间版本号

This commit is contained in:
2026-08-24 09:20:04 +08:00
parent e79bbfb99c
commit 7aca9a9394
15 changed files with 75 additions and 46 deletions
+3 -3
View File
@@ -95,8 +95,6 @@ void assign_config_section(Config_Section section, Function&& function) {
}
Psc::JSON config_section_value(Global& global, Config_Section section) {
switch (section) {
case Config_Section::version:
return Psc::JSON(global.version);
case Config_Section::dsp:
return global.dsp_config.to_base_json();
case Config_Section::drogon:
@@ -236,10 +234,13 @@ void Mode_ACS_Config::from_json(const Psc::JSON* that_json) {
migrate_legacy_source_feed_relations(that_json, data_source_config, data_feed_config);
data_topology_view.write([&](auto& value) { value.from_json(that_json->get("data_topology_view")); });
}
Config::Config() : version(get_ecap_build_version()) {
}
void Config::create_missing_config_files() {
std::filesystem::create_directories(config_directory());
std::error_code ignored_error;
std::filesystem::remove(config_directory() / "device.json", ignored_error);
std::filesystem::remove(config_directory() / "version.json", ignored_error);
for (std::size_t index = 0; index < static_cast<std::size_t>(Config_Section::count); ++index) {
const auto section = static_cast<Config_Section>(index);
if (std::filesystem::exists(config_section_path(section)))
@@ -270,7 +271,6 @@ void Config::from_log_json(const Psc::JSON* that_json) {
assign_config_section(Config_Section::log, [&] { log_config.from_base_json(that_json); });
}
void Config::from_base_json(Psc::JSON* that_json) {
assign_config_section(Config_Section::version, [&] { Get_J(version) });
assign_config_section(Config_Section::mlat, [&] { mlat.from_json(that_json->get("mlat")); });
assign_config_section(Config_Section::web_server,
[&] { web_server_config.from_base_json(that_json->get("web_server")); });