diff --git a/applications/vision/src/main.cpp b/applications/vision/src/main.cpp index aba47f6cd970f5548df5e0364c8675fff8c13960..4190a90d0cc5b6074e5dbf2e6bacb74597b3e06f 100644 --- a/applications/vision/src/main.cpp +++ b/applications/vision/src/main.cpp @@ -96,6 +96,8 @@ static void run(ftl::Configurable *root) { stream->add(source); stream->run(); + LOG(INFO) << "Running..."; + while (ftl::running && display->active()) { cv::Mat rgb, depth; source->getRGBD(rgb, depth); @@ -130,6 +132,7 @@ int main(int argc, char **argv) { delete root; LOG(INFO) << "Terminating with code " << ftl::exit_code; + LOG(INFO) << "Branch: " << ftl::branch_name; return ftl::exit_code; } diff --git a/components/common/cpp/include/ftl/configuration.hpp b/components/common/cpp/include/ftl/configuration.hpp index d38472746254587e4f495547ba48e095f750ed12..3938b29b772d3f660baa363d269826e8d8e4b0d5 100644 --- a/components/common/cpp/include/ftl/configuration.hpp +++ b/components/common/cpp/include/ftl/configuration.hpp @@ -14,6 +14,7 @@ namespace ftl { extern bool running; extern int exit_code; +extern std::string branch_name; class Configurable; diff --git a/components/common/cpp/src/configuration.cpp b/components/common/cpp/src/configuration.cpp index f8bf95aec56fc577499db8eb2decfb70a9c346b6..52e8998f8812fe1445f9659f9b80e2ccc45467fe 100644 --- a/components/common/cpp/src/configuration.cpp +++ b/components/common/cpp/src/configuration.cpp @@ -49,6 +49,7 @@ static Configurable *rootCFG = nullptr; bool ftl::running = true; int ftl::exit_code = 0; +std::string ftl::branch_name = ""; bool ftl::is_directory(const std::string &path) { #ifdef WIN32 @@ -466,6 +467,15 @@ Configurable *ftl::config::configure(int argc, char **argv, const std::string &r rootcfg->set("paths", paths); process_options(rootcfg, options); + if (rootcfg->get<std::string>("branch")) { + ftl::branch_name = *rootcfg->get<std::string>("branch"); + } + rootcfg->on("branch", [](const ftl::config::Event &e) { + if (e.entity->get<std::string>("branch")) { + ftl::branch_name = *e.entity->get<std::string>("branch"); + } + }); + //LOG(INFO) << "CONFIG: " << config["vision_default"]; //CHECK_EQ( &config, config_index["ftl://utu.fi"] );