Skip to content

Commit

Permalink
Fix dialog open flow.
Browse files Browse the repository at this point in the history
Remove trailing whitespaces

Change-Id: Ia737c46f3f17ad99745831730d50f24aef064f02
  • Loading branch information
ev-mp committed May 6, 2018
1 parent f316d85 commit 98a3538
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 43 deletions.
22 changes: 10 additions & 12 deletions common/model-views.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#define ARCBALL_CAMERA_IMPLEMENTATION
#include <arcball_camera.h>

constexpr const char* recommended_fw_url = "https://downloadcenter.intel.com/download/27522/Latest-Firmware-for-Intel-RealSense-D400-Product-Family?v=t";

using namespace rs400;
using namespace nlohmann;
Expand Down Expand Up @@ -59,18 +60,19 @@ void open_url(const char* url)
#if (defined(_WIN32) || defined(_WIN64))
if (reinterpret_cast<int>(ShellExecuteA(NULL, "open", url, NULL, NULL, SW_SHOW)) < 32)
throw std::runtime_error("Failed opening URL");
#endif
#if defined __linux__ || defined(__linux__)
#elif defined __linux__ || defined(__linux__)
std::string command_name = "xdg-open ";
std::string command = command_name + url;
if (system(command.c_str()))
throw std::runtime_error("Failed opening URL");
#endif
#ifdef __APPLE__
#elif __APPLE__
std::string command_name = "open ";
std::string command = command_name + url;
if (system(command.c_str()))
throw std::runtime_error("Failed opening URL");
#else
#pragma message ( "\nLibrealsense couldn't establish OS/Build environment. \
Some auxillary functionalities might be affected. Please report this message if encountered")
#endif
}
Expand Down Expand Up @@ -5206,7 +5208,6 @@ namespace rs2
{
if (is_advanced_mode_enabled)
{
auto ret = file_dialog_open(open_file, "JavaScript Object Notation (JSON)\0*.json\0", NULL, NULL);
json_loading([&]()
{
auto ret = file_dialog_open(open_file, "JavaScript Object Notation (JSON)\0*.json\0", NULL, NULL);
Expand Down Expand Up @@ -6071,7 +6072,6 @@ namespace rs2
}
}


const int notification_model::get_max_lifetime_ms() const
{
if (category == RS2_NOTIFICATION_CATEGORY_FIRMWARE_UPDATE_RECOMMENDED)
Expand All @@ -6080,8 +6080,7 @@ namespace rs2
}
return 10000;
}



void notification_model::draw(int w, int y, notification_model& selected)
{
auto flags = ImGuiWindowFlags_NoResize |
Expand Down Expand Up @@ -6132,12 +6131,11 @@ namespace rs2
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, { 62 / 255.f + 0.1f, 77 / 255.f + 0.1f, 89 / 255.f + 0.1f, 1 - t });
ImGui::PushStyleColor(ImGuiCol_ButtonActive, { 62 / 255.f - 0.1f, 77 / 255.f - 0.1f, 89 / 255.f - 0.1f, 1 - t });
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 2);

const char* url = "https://downloadcenter.intel.com/download/27522/Latest-Firmware-for-Intel-RealSense-D400-Product-Family?v=t";

ImGui::Indent(80);
if (ImGui::Button("Download update", { 130, 30 }))
{
open_url(url);
{
open_url(recommended_fw_url);
}
if (ImGui::IsItemHovered())
ImGui::SetTooltip("%s", "Internet connection required");
Expand Down
2 changes: 1 addition & 1 deletion common/model-views.h
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ namespace rs2
void set_color_scheme(float t) const;
void clear_color_scheme() const;
const int get_max_lifetime_ms() const;

int height = 40;
int index = 0;
std::string message;
Expand Down
2 changes: 1 addition & 1 deletion examples/C/depth/rs-depth.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ int main()
rs2_release_frame(frame);
continue;
}

/* Retrieve depth data, configured as 16-bit depth values */
const uint16_t* depth_frame_data = (const uint16_t*)(rs2_get_frame_data(frame, &e));
check_error(e);
Expand Down
6 changes: 3 additions & 3 deletions examples/record-playback/rs-record-playback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ int main(int argc, char * argv[]) try
pipe->start(cfg); //File will be opened at this point
device = pipe->get_active_profile().get_device();
}
else
else
{ // If the recording is resumed after a pause, there's no need to reset the shared pointer
device.as<rs2::recorder>().resume(); // rs2::recorder allows access to 'resume' function
}
Expand All @@ -108,7 +108,7 @@ int main(int argc, char * argv[]) try
*/
if (device.as<rs2::recorder>())
{
if (recording)
if (recording)
{
ImGui::SetCursorPos({ app.width() / 2 - 100, 3 * app.height() / 5 + 60 });
ImGui::TextColored({ 255 / 255.f, 64 / 255.f, 54 / 255.f, 1 }, "Recording to file 'a.bag'");
Expand Down Expand Up @@ -157,7 +157,7 @@ int main(int argc, char * argv[]) try
}
}
}

// If device is playing a recording, we allow pause and stop
if (device.as<rs2::playback>())
{
Expand Down
2 changes: 1 addition & 1 deletion include/librealsense2/h/rs_processing.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ rs2_processing_block* rs2_create_processing_block(rs2_frame_processor_callback*
* This method creates new custom processing block from function pointer. This lets the users pass frames between module boundaries for processing
* This is an infrastructure function aimed at middleware developers, and also used by provided blocks such as sync, colorizer, etc..
* \param proc Processing function pointer to be applied to every frame entering the block
* \param context User context (can be anything or null) to be passed later as ctx param of the callback
* \param context User context (can be anything or null) to be passed later as ctx param of the callback
* \param[out] error if non-null, receives any error that occurs during this call, otherwise, errors are ignored
* \return new processing block, to be released by rs2_delete_processing_block
*/
Expand Down
2 changes: 1 addition & 1 deletion include/librealsense2/h/rs_sensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ typedef enum rs2_stream
RS2_STREAM_GYRO , /**< Native stream of gyroscope motion data produced by RealSense device */
RS2_STREAM_ACCEL , /**< Native stream of accelerometer motion data produced by RealSense device */
RS2_STREAM_GPIO , /**< Signals from external device connected through GPIO */
RS2_STREAM_POSE , /**< 6 Degrees of Freedom pose data, calculated by RealSense device */
RS2_STREAM_POSE , /**< 6 Degrees of Freedom pose data, calculated by RealSense device */
RS2_STREAM_CONFIDENCE,
RS2_STREAM_COUNT
} rs2_stream;
Expand Down
12 changes: 6 additions & 6 deletions include/librealsense2/h/rs_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,18 +128,18 @@ typedef enum rs2_matchers
{
RS2_MATCHER_DI, //compare depth and ir based on frame number

RS2_MATCHER_DI_C, //compare depth and ir based on frame number,
//compare the pair of corresponding depth and ir with color based on closest timestamp,
RS2_MATCHER_DI_C, //compare depth and ir based on frame number,
//compare the pair of corresponding depth and ir with color based on closest timestamp,
//commonlly used by SR300

RS2_MATCHER_DLR_C, //compare depth, left and right ir based on frame number,
//compare the set of corresponding depth, left and right with color based on closest timestamp,
RS2_MATCHER_DLR_C, //compare depth, left and right ir based on frame number,
//compare the set of corresponding depth, left and right with color based on closest timestamp,
//commonlly used by RS415, RS435

RS2_MATCHER_DLR, //compare depth, left and right ir based on frame number,
RS2_MATCHER_DLR, //compare depth, left and right ir based on frame number,
//commonlly used by RS400, RS405, RS410, RS420, RS430

RS2_MATCHER_DEFAULT, //the default matcher compare all the streams based on closest timestamp
RS2_MATCHER_DEFAULT, //the default matcher compare all the streams based on closest timestamp

RS2_MATCHER_COUNT
}rs2_matchers;
Expand Down
8 changes: 3 additions & 5 deletions src/ds5/ds5-device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -567,15 +567,15 @@ namespace librealsense
register_info(RS2_CAMERA_INFO_ADVANCED_MODE, ((advanced_mode) ? "YES" : "NO"));
register_info(RS2_CAMERA_INFO_PRODUCT_ID, pid_hex_str);
register_info(RS2_CAMERA_INFO_RECOMMENDED_FIRMWARE_VERSION, recommended_fw_version);

if (usb_modality)
register_info(RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR, usb_type_str);

std::string curr_version= _fw_version;
std::string latest_version = recommended_fw_version;

if (_fw_version < recommended_fw_version)
{
{
std::weak_ptr<notifications_processor> weak = depth_ep.get_notifications_processor();
std::thread notification_thread = std::thread([weak, curr_version, latest_version]()
{
Expand All @@ -598,9 +598,7 @@ namespace librealsense

});
notification_thread.detach();

}

}

notification ds5_notification_decoder::decode(int value)
Expand Down
2 changes: 1 addition & 1 deletion src/rs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1551,7 +1551,7 @@ rs2_processing_block* rs2_create_processing_block_fptr(rs2_frame_processor_callb

auto block = std::make_shared<librealsense::processing_block>();

block->set_processing_callback({
block->set_processing_callback({
new librealsense::internal_frame_processor_fptr_callback(proc, context),
[](rs2_frame_processor_callback* p) { } });

Expand Down
2 changes: 1 addition & 1 deletion src/win/win-uvc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,7 @@ namespace librealsense
}
catch (...)
{
LOG_WARNING("Accessing USB info failed for " << std::hex << info.vid << ":"
LOG_WARNING("Accessing USB info failed for " << std::hex << info.vid << ":"
<< info.pid << " , id:" << info.unique_id);
}
}
Expand Down
20 changes: 9 additions & 11 deletions wrappers/python/python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,7 @@ PYBIND11_MODULE(NAME, m) {
.def(BIND_DOWNCAST(frame, video_frame))
.def(BIND_DOWNCAST(frame, depth_frame));





py::class_<rs2::video_frame, rs2::frame> video_frame(m, "video_frame");
video_frame.def(py::init<rs2::frame>())
.def("get_width", &rs2::video_frame::get_width, "Returns image width in pixels.")
Expand Down Expand Up @@ -513,7 +511,7 @@ PYBIND11_MODULE(NAME, m) {
// Do we need this?
py::class_<rs2::process_interface, rs2::options> process_interface(m, "process_interface");
process_interface.def("process", &rs2::process_interface::process, "frame"_a);

py::class_<rs2::decimation_filter, rs2::process_interface> decimation_filter(m, "decimation_filter");
decimation_filter.def(py::init<>());

Expand Down Expand Up @@ -934,23 +932,23 @@ PYBIND11_MODULE(NAME, m) {
.def("set_rau_support_vector_control", &rs400::advanced_mode::set_rau_support_vector_control, "group"_a)//STRauSupportVectorControl
.def("get_rau_support_vector_control", &rs400::advanced_mode::get_rau_support_vector_control, "mode"_a = 0)
.def("set_color_control", &rs400::advanced_mode::set_color_control, "group"_a) //STColorControl
.def("get_color_control", &rs400::advanced_mode::get_color_control, "mode"_a = 0)//STColorControl
.def("get_color_control", &rs400::advanced_mode::get_color_control, "mode"_a = 0)//STColorControl
.def("set_rau_thresholds_control", &rs400::advanced_mode::set_rau_thresholds_control, "group"_a)//STRauColorThresholdsControl
.def("get_rau_thresholds_control", &rs400::advanced_mode::get_rau_thresholds_control, "mode"_a = 0)
.def("set_slo_color_thresholds_control", &rs400::advanced_mode::set_slo_color_thresholds_control, "group"_a)//STSloColorThresholdsControl
.def("get_slo_color_thresholds_control", &rs400::advanced_mode::get_slo_color_thresholds_control, "mode"_a = 0)//STSloColorThresholdsControl
.def("get_slo_color_thresholds_control", &rs400::advanced_mode::get_slo_color_thresholds_control, "mode"_a = 0)//STSloColorThresholdsControl
.def("set_slo_penalty_control", &rs400::advanced_mode::set_slo_penalty_control, "group"_a) //STSloPenaltyControl
.def("get_slo_penalty_control", &rs400::advanced_mode::get_slo_penalty_control, "mode"_a = 0)//STSloPenaltyControl
.def("get_slo_penalty_control", &rs400::advanced_mode::get_slo_penalty_control, "mode"_a = 0)//STSloPenaltyControl
.def("set_hdad", &rs400::advanced_mode::set_hdad, "group"_a) //STHdad
.def("get_hdad", &rs400::advanced_mode::get_hdad, "mode"_a = 0)
.def("set_color_correction", &rs400::advanced_mode::set_color_correction, "group"_a)
.def("get_color_correction", &rs400::advanced_mode::get_color_correction, "mode"_a = 0) //STColorCorrection
.def("get_color_correction", &rs400::advanced_mode::get_color_correction, "mode"_a = 0) //STColorCorrection
.def("set_depth_table", &rs400::advanced_mode::set_depth_table, "group"_a)
.def("get_depth_table", &rs400::advanced_mode::get_depth_table, "mode"_a = 0) //STDepthTableControl
.def("get_depth_table", &rs400::advanced_mode::get_depth_table, "mode"_a = 0) //STDepthTableControl
.def("set_ae_control", &rs400::advanced_mode::set_ae_control, "group"_a)
.def("get_ae_control", &rs400::advanced_mode::get_ae_control, "mode"_a = 0) //STAEControl
.def("get_ae_control", &rs400::advanced_mode::get_ae_control, "mode"_a = 0) //STAEControl
.def("set_census", &rs400::advanced_mode::set_census, "group"_a) //STCensusRadius
.def("get_census", &rs400::advanced_mode::get_census, "mode"_a = 0) //STCensusRadius
.def("get_census", &rs400::advanced_mode::get_census, "mode"_a = 0) //STCensusRadius
.def("serialize_json", &rs400::advanced_mode::serialize_json)
.def("load_json", &rs400::advanced_mode::load_json, "json_content"_a);

Expand Down

0 comments on commit 98a3538

Please sign in to comment.