Skip to content
Snippets Groups Projects
Commit bb6cc858 authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Allow branch change on exit

parent 897c32bc
No related branches found
No related tags found
No related merge requests found
Pipeline #11258 passed
......@@ -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;
}
......@@ -14,6 +14,7 @@ namespace ftl {
extern bool running;
extern int exit_code;
extern std::string branch_name;
class Configurable;
......
......@@ -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"] );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment