-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add dds config tool #13628
base: development
Are you sure you want to change the base?
add dds config tool #13628
Conversation
4c15cb3
to
6234882
Compare
6234882
to
7e2db73
Compare
@@ -0,0 +1,332 @@ | |||
#include "dds-model.h" | |||
// License: Apache 2.0. See LICENSE file in root directory. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Misplaced, should be on top
tools/dds/dds-config/CMakeLists.txt
Outdated
@@ -9,6 +9,7 @@ file( GLOB_RECURSE RS_DDS_CONFIG_SOURCE_FILES | |||
LIST_DIRECTORIES false | |||
RELATIVE ${PROJECT_SOURCE_DIR} | |||
"${CMAKE_CURRENT_LIST_DIR}/*" | |||
"${PROJECT_SOURCE_DIR}/../../../third-party/rsutils/include/rsutils/type/*" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This path seems weird..
relative to the source dir we only need third-party/rsutils/include/rsutils/type/*
no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The source dir for the dds tool is librealsense\tools\dds\dds-config so only using part of the path won't work but I can set the THIRD_PARTY_DIR so it looks more readable:
set(THIRD_PARTY_DIR "${PROJECT_SOURCE_DIR}/../../../third-party")
"${THIRD_PARTY_DIR}/rsutils/include/rsutils/type/*"
common/device-model.cpp
Outdated
@@ -1457,6 +1472,7 @@ namespace rs2 | |||
} | |||
|
|||
_calib_model.update(window, error_message); | |||
_dds_model.render_dds_config_window(window , error_message); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this work id we build with DDS off?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll add a check to see if the device supports DDS before using this function.
But in general, yes the functionality works with DDS off because the function already checks whether the window should be open. If the device doesn't support DDS, the window is closed by default.
common/device-model.cpp
Outdated
@@ -1435,6 +1436,20 @@ namespace rs2 | |||
} | |||
} | |||
} | |||
ImGuiSelectableFlags is_streaming_flag = (is_streaming) ? ImGuiSelectableFlags_Disabled : 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the difference between 0 and ImGuiSelectableFlags_Disabled
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0 is equal to ImGuiSelectableFlags_None that will show the "DDS Configuration" option an enabled
and using the ImGuiSelectableFlags_Disabled will show this option as disabled (faded and not allowing clicks on it)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So why not replace 0 with ImGuiSelectableFlags_None
?
common/dds-model.h
Outdated
#include <set> | ||
#include <rsutils/type/ip-address.h> | ||
#include <rsutils/string/hexdump.h> | ||
#include "../third-party/rsutils/include/rsutils/type/eth-config.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we also use <>?
<party/rsutils/include/rsutils/type/eth-config.h>
?
eth_config _current_config; | ||
eth_config _changed_config; | ||
|
||
bool _window_open; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not initialized but other is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initialized _window_open to false as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initialized in the constructor initialization list
common/dds-model.cpp
Outdated
if (ImGui::InputText(label_name.c_str(), buffer, sizeof(buffer))) { | ||
std::string new_ip_str(buffer); | ||
if (rsutils::type::ip_address(new_ip_str).is_valid()) { | ||
ip = rsutils::type::ip_address(new_ip_str); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why calling it twice?
Maybe call it once and use it on both cases?
common/dds-model.cpp
Outdated
if (rsutils::type::ip_address(new_ip_str).is_valid()) { | ||
ip = rsutils::type::ip_address(new_ip_str); | ||
} | ||
else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new line please for the {
common/dds-model.cpp
Outdated
ImGui::Text("DHCP Timeout (seconds)"); | ||
ImGui::SameLine(); | ||
int tempTimeout = static_cast<int>(_changed_config.dhcp.timeout); | ||
if (ImGui::InputInt("##DHCP Timeout (seconds)", &tempTimeout)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please place { on a new line for all uses here.
I will send you a mail about using clang format
@Noy-Zini can you please build a version for us to play with and check? |
4bead95
to
16d7803
Compare
common/dds-model.cpp
Outdated
|
||
bool rs2::dds_model::supports_DDS() | ||
{ | ||
return _dds_suported; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
supported
16d7803
to
6cb2c25
Compare
Tracked on : [RSDEV-2884]