diff --git a/common/model-views.cpp b/common/model-views.cpp index b305469982..7aac7a9c7e 100644 --- a/common/model-views.cpp +++ b/common/model-views.cpp @@ -26,6 +26,7 @@ #define ARCBALL_CAMERA_IMPLEMENTATION #include +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; @@ -59,18 +60,19 @@ void open_url(const char* url) #if (defined(_WIN32) || defined(_WIN64)) if (reinterpret_cast(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 } @@ -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); @@ -6071,7 +6072,6 @@ namespace rs2 } } - const int notification_model::get_max_lifetime_ms() const { if (category == RS2_NOTIFICATION_CATEGORY_FIRMWARE_UPDATE_RECOMMENDED) @@ -6080,8 +6080,7 @@ namespace rs2 } return 10000; } - - + void notification_model::draw(int w, int y, notification_model& selected) { auto flags = ImGuiWindowFlags_NoResize | @@ -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"); diff --git a/common/model-views.h b/common/model-views.h index fa3e63e96b..ac8760dbc2 100644 --- a/common/model-views.h +++ b/common/model-views.h @@ -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; diff --git a/examples/C/depth/rs-depth.c b/examples/C/depth/rs-depth.c index 3ccf093509..555c5ec0b0 100644 --- a/examples/C/depth/rs-depth.c +++ b/examples/C/depth/rs-depth.c @@ -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); diff --git a/examples/record-playback/rs-record-playback.cpp b/examples/record-playback/rs-record-playback.cpp index 7a3828bbf7..05c1752e93 100644 --- a/examples/record-playback/rs-record-playback.cpp +++ b/examples/record-playback/rs-record-playback.cpp @@ -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().resume(); // rs2::recorder allows access to 'resume' function } @@ -108,7 +108,7 @@ int main(int argc, char * argv[]) try */ if (device.as()) { - 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'"); @@ -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()) { diff --git a/include/librealsense2/h/rs_processing.h b/include/librealsense2/h/rs_processing.h index 59690fe875..0f9d77157a 100644 --- a/include/librealsense2/h/rs_processing.h +++ b/include/librealsense2/h/rs_processing.h @@ -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 */ diff --git a/include/librealsense2/h/rs_sensor.h b/include/librealsense2/h/rs_sensor.h index c16f3657e0..672a5bc485 100644 --- a/include/librealsense2/h/rs_sensor.h +++ b/include/librealsense2/h/rs_sensor.h @@ -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; diff --git a/include/librealsense2/h/rs_types.h b/include/librealsense2/h/rs_types.h index 6ad0439584..50705a45d9 100644 --- a/include/librealsense2/h/rs_types.h +++ b/include/librealsense2/h/rs_types.h @@ -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; diff --git a/src/ds5/ds5-device.cpp b/src/ds5/ds5-device.cpp index 00d5e1f4fc..00f83709f3 100644 --- a/src/ds5/ds5-device.cpp +++ b/src/ds5/ds5-device.cpp @@ -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 weak = depth_ep.get_notifications_processor(); std::thread notification_thread = std::thread([weak, curr_version, latest_version]() { @@ -598,9 +598,7 @@ namespace librealsense }); notification_thread.detach(); - } - } notification ds5_notification_decoder::decode(int value) diff --git a/src/rs.cpp b/src/rs.cpp index ad3229a1a6..c8c0b51cc9 100644 --- a/src/rs.cpp +++ b/src/rs.cpp @@ -1551,7 +1551,7 @@ rs2_processing_block* rs2_create_processing_block_fptr(rs2_frame_processor_callb auto block = std::make_shared(); - block->set_processing_callback({ + block->set_processing_callback({ new librealsense::internal_frame_processor_fptr_callback(proc, context), [](rs2_frame_processor_callback* p) { } }); diff --git a/src/win/win-uvc.cpp b/src/win/win-uvc.cpp index ef2ada291f..b32e59d088 100644 --- a/src/win/win-uvc.cpp +++ b/src/win/win-uvc.cpp @@ -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); } } diff --git a/wrappers/python/python.cpp b/wrappers/python/python.cpp index 7a4953b948..d01f678af9 100644 --- a/wrappers/python/python.cpp +++ b/wrappers/python/python.cpp @@ -354,9 +354,7 @@ PYBIND11_MODULE(NAME, m) { .def(BIND_DOWNCAST(frame, video_frame)) .def(BIND_DOWNCAST(frame, depth_frame)); - - - + py::class_ video_frame(m, "video_frame"); video_frame.def(py::init()) .def("get_width", &rs2::video_frame::get_width, "Returns image width in pixels.") @@ -513,7 +511,7 @@ PYBIND11_MODULE(NAME, m) { // Do we need this? py::class_ process_interface(m, "process_interface"); process_interface.def("process", &rs2::process_interface::process, "frame"_a); - + py::class_ decimation_filter(m, "decimation_filter"); decimation_filter.def(py::init<>()); @@ -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);