|
|
@@ -8,11 +8,10 @@
|
|
|
using boost::asio::io_context;
|
|
|
using boost::asio::post;
|
|
|
|
|
|
-extern io_context *main_ctx;
|
|
|
-
|
|
|
orb_camera_ui::impl::impl(create_config conf) {
|
|
|
+ ctx = conf.ctx;
|
|
|
cam_c_conf.stream = conf.stream;
|
|
|
- cam_c_conf.ctx = main_ctx;
|
|
|
+ cam_c_conf.ctx = ctx;
|
|
|
cam_s_conf.color.name = conf.cf_name;
|
|
|
cam_s_conf.depth.name = conf.df_name;
|
|
|
|
|
|
@@ -78,7 +77,7 @@ void orb_camera_ui::impl::show_config() {
|
|
|
}
|
|
|
ImGui::SameLine();
|
|
|
if (ImGui::Button("R")) {
|
|
|
- post(*main_ctx, [this] { refresh_dev_info_list(); });
|
|
|
+ post(*ctx, [this] { refresh_dev_info_list(); });
|
|
|
}
|
|
|
|
|
|
// select video config
|
|
|
@@ -122,21 +121,21 @@ void orb_camera_ui::impl::show() {
|
|
|
if (cam == nullptr) {
|
|
|
auto guard = imgui_disable_guard(dev_info_list.empty());
|
|
|
if (ImGui::Button("Open")) {
|
|
|
- post(*main_ctx, [this] { open_camera(); });
|
|
|
+ post(*ctx, [this] { open_camera(); });
|
|
|
}
|
|
|
} else {
|
|
|
assert(cam != nullptr);
|
|
|
if (ImGui::Button("Close")) {
|
|
|
- post(*main_ctx, [this] { cam = nullptr; });
|
|
|
+ post(*ctx, [this] { cam = nullptr; });
|
|
|
}
|
|
|
ImGui::SameLine();
|
|
|
if (!cam->is_capturing()) {
|
|
|
if (ImGui::Button("Start")) {
|
|
|
- post(*main_ctx, [this] { start_camera(); });
|
|
|
+ post(*ctx, [this] { start_camera(); });
|
|
|
}
|
|
|
} else {
|
|
|
if (ImGui::Button("Stop")) {
|
|
|
- post(*main_ctx, [this] { cam->stop(); });
|
|
|
+ post(*ctx, [this] { cam->stop(); });
|
|
|
}
|
|
|
}
|
|
|
}
|