From 5fb2de44270e8bf51ec5318234a8c9332ebc3829 Mon Sep 17 00:00:00 2001 From: Eran Date: Mon, 20 Nov 2023 07:35:52 +0200 Subject: [PATCH] tools --sw-only overrides 'dds' --- tools/enumerate-devices/rs-enumerate-devices.cpp | 7 +++++-- tools/realsense-viewer/realsense-viewer.cpp | 5 ++++- tools/terminal/rs-terminal.cpp | 5 ++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/tools/enumerate-devices/rs-enumerate-devices.cpp b/tools/enumerate-devices/rs-enumerate-devices.cpp index efe8a367893..4d78751f827 100644 --- a/tools/enumerate-devices/rs-enumerate-devices.cpp +++ b/tools/enumerate-devices/rs-enumerate-devices.cpp @@ -358,8 +358,11 @@ int main(int argc, char** argv) try json settings; #ifdef BUILD_WITH_DDS json dds; - dds["domain"] = domain_arg.getValue(); - settings["dds"] = std::move( dds ); + if( domain_arg.isSet() ) + dds["domain"] = domain_arg.getValue(); + if( only_sw_arg.isSet() ) + dds["enabled"] = true; // override global dds:false or dds/enabled:false, if any + settings["dds"] = std::move( dds ); #endif settings["format-conversion"] = format_arg.getValue(); context ctx( settings.dump() ); diff --git a/tools/realsense-viewer/realsense-viewer.cpp b/tools/realsense-viewer/realsense-viewer.cpp index d725ac99b70..c0f1c59756c 100644 --- a/tools/realsense-viewer/realsense-viewer.cpp +++ b/tools/realsense-viewer/realsense-viewer.cpp @@ -332,9 +332,12 @@ int main(int argc, const char** argv) try std::shared_ptr device_models = std::make_shared(); - nlohmann::json settings; + nlohmann::json settings = nlohmann::json::object(); if( only_sw_arg.getValue() ) + { + settings["dds"]["enabled"] = true; // override global dds:false or dds/enabled:false, if any settings["device-mask"] = RS2_PRODUCT_LINE_SW_ONLY | RS2_PRODUCT_LINE_ANY; + } context ctx( settings.dump() ); ux_window window("Intel RealSense Viewer", ctx); diff --git a/tools/terminal/rs-terminal.cpp b/tools/terminal/rs-terminal.cpp index cc38a501458..3525e6d4dd2 100644 --- a/tools/terminal/rs-terminal.cpp +++ b/tools/terminal/rs-terminal.cpp @@ -200,7 +200,10 @@ int main(int argc, char** argv) nlohmann::json settings; #ifdef BUILD_WITH_DDS nlohmann::json dds; - dds["domain"] = domain_arg.getValue(); + if( domain_arg.isSet() ) + dds["domain"] = domain_arg.getValue(); + if( only_sw_arg.isSet() ) + dds["enabled"] = true; // override global dds:false or dds/enabled:false, if any settings["dds"] = std::move( dds ); #endif if( only_sw_arg.getValue() )