diff --git a/components/common/cpp/src/configurable.cpp b/components/common/cpp/src/configurable.cpp index 6ded7367f6e28492c501351069c0bd570d96a069..c947eadada1e6f353b34341a6a3c440d1ccbfbe1 100644 --- a/components/common/cpp/src/configurable.cpp +++ b/components/common/cpp/src/configurable.cpp @@ -40,6 +40,8 @@ void Configurable::save() { } void Configurable::restore(const std::string &key, const std::unordered_set<std::string> &allowed) { + save(); + auto &r = ftl::config::getRestore(key); if (r.is_object()) { config_->merge_patch(r); diff --git a/components/rgbd-sources/src/source.cpp b/components/rgbd-sources/src/source.cpp index adc237b1c935d9efd4dd0aed6fd3c82422d7945d..02710bc8700a0a478959a9eeca688db95cf48d55 100644 --- a/components/rgbd-sources/src/source.cpp +++ b/components/rgbd-sources/src/source.cpp @@ -158,6 +158,16 @@ void Source::reset() { auto uristr = get<string>("uri"); if (!uristr) return; + + restore(*uristr, { + "min_depth", + "max_depth", + "name", + "offset_z", + "size", + "focal", + "device_left" + }); impl_ = createImplementation(*uristr, this); } diff --git a/components/rgbd-sources/src/sources/stereovideo/stereovideo.cpp b/components/rgbd-sources/src/sources/stereovideo/stereovideo.cpp index f09820922ba4ff9b5a34c0b82b0e2b5575ce3304..aede12becf921772042af76c2953f71f7564ccf2 100644 --- a/components/rgbd-sources/src/sources/stereovideo/stereovideo.cpp +++ b/components/rgbd-sources/src/sources/stereovideo/stereovideo.cpp @@ -170,6 +170,14 @@ void StereoVideoSource::init(const string &file) { LOG(INFO) << "StereoVideo source ready..."; ready_ = true; + + host_->on("size", [this](const ftl::config::Event &e) { + do_update_params_ = true; + }); + + host_->on("offset_z", [this](const ftl::config::Event &e) { + do_update_params_ = true; + }); } ftl::rgbd::Camera StereoVideoSource::parameters(Channel chan) {