Skip to content

Commit

Permalink
Merge pull request #2739 from ev-mp/current
Browse files Browse the repository at this point in the history
Adjust Viewer stream info for IMU stream.
Promote to v2.16.5
  • Loading branch information
ev-mp authored Nov 18, 2018
2 parents 27d83ea + b4d4a60 commit 423bf19
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
21 changes: 17 additions & 4 deletions common/model-views.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@ ImVec4 flip(const ImVec4& c)
return{ c.y, c.x, c.z, c.w };
}

// Use shortcuts for long names to avoid trimming of essential data
std::string truncate_string(const std::string& str, size_t width)
{
if (str.length() > width)
{
std::stringstream ss;
ss << str.substr(0,width/3) << "..." << str.substr(str.length()-width/3);
return ss.str().c_str();
}
return str;
}

ImVec4 from_rgba(uint8_t r, uint8_t g, uint8_t b, uint8_t a, bool consistent_color)
{
auto res = ImVec4(r / (float)255, g / (float)255, b / (float)255, a / (float)255);
Expand Down Expand Up @@ -2496,9 +2508,10 @@ namespace rs2
std::string label = to_string() << "Stream Info of " << profile.unique_id();
ImGui::Begin(label.c_str(), nullptr, flags);

label = to_string() << size.x << "x" << size.y << ", "
<< rs2_format_to_string(profile.format()) << ", "
<< "FPS:";
std::string res;
if (profile.as<rs2::video_stream_profile>())
res = to_string() << size.x << "x" << size.y << ", ";
label = to_string() << res << truncate_string(rs2_format_to_string(profile.format()),9) << ", FPS:";
ImGui::Text("%s", label.c_str());
ImGui::SameLine();

Expand All @@ -2515,7 +2528,7 @@ namespace rs2

ImGui::Columns(2, 0, false);
ImGui::SetColumnOffset(1, 160);
label = to_string() << "Timestamp: " << std::fixed << std::setprecision(3) << timestamp;
label = to_string() << "Timestamp: " << std::fixed << std::setprecision(1) << timestamp;
ImGui::Text("%s", label.c_str());
ImGui::NextColumn();

Expand Down
2 changes: 1 addition & 1 deletion include/librealsense2/rs.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ extern "C" {

#define RS2_API_MAJOR_VERSION 2
#define RS2_API_MINOR_VERSION 16
#define RS2_API_PATCH_VERSION 4
#define RS2_API_PATCH_VERSION 5
#define RS2_API_BUILD_VERSION 0

#define STRINGIFY(arg) #arg
Expand Down
2 changes: 1 addition & 1 deletion package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<package format="2">
<name>librealsense2</name>
<!-- The version tag needs to be updated with each new release of librealsense -->
<version>2.16.3</version>
<version>2.16.5</version>
<description>
Library for capturing data from the Intel(R) RealSense(TM) SR300 and D400 cameras. This effort was initiated to better support researchers, creative coders, and app developers in domains such as robotics, virtual reality, and the internet of things. Several often-requested features of RealSense(TM); devices are implemented in this project, including multi-camera capture.
</description>
Expand Down

0 comments on commit 423bf19

Please sign in to comment.