Xong phần map viewer
Some checks failed
Test / test (push) Has been cancelled

This commit is contained in:
2026-06-20 09:18:19 +02:00
parent 819323f8c8
commit 90e8e9d252
13 changed files with 431 additions and 32 deletions

View File

@@ -21,6 +21,24 @@
namespace lm {
namespace {
bool isProjectRootDataPath(const std::filesystem::path& parent)
{
return parent.empty() || parent == std::filesystem::path(".");
}
std::filesystem::path resolveDataPath(std::filesystem::path data_path)
{
if (!isProjectRootDataPath(data_path.parent_path()))
return data_path;
if (data_path.filename() == "state.json")
return std::filesystem::path("data") / "state.json";
return std::filesystem::path("data") / "RBS.db";
}
} // namespace
LidarManagerApp::LidarManagerApp(int port,
std::filesystem::path www_root,
std::filesystem::path data_path)
@@ -30,6 +48,7 @@ LidarManagerApp::LidarManagerApp(int port,
int LidarManagerApp::run()
{
data_path_ = resolveDataPath(data_path_);
const std::filesystem::path data_dir = data_path_.parent_path();
Database database(data_dir);
std::string db_err;