Skip to content

Commit c1c97e9

Browse files
authored
Merge pull request #4867 from dorodnic/autocalib_adjustments
On-Chip Calibration Adjustments
2 parents ce7cf1c + ce53f6e commit c1c97e9

File tree

10 files changed

+269
-185
lines changed

10 files changed

+269
-185
lines changed

common/fw-update-helper.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,11 @@ namespace rs2
3838
RS2_FWU_STATE_FAILED = 3,
3939
};
4040

41-
bool is_recommended_fw_available()
41+
bool is_recommended_fw_available(std::string id)
4242
{
43-
return !(strcmp("", FW_D4XX_FW_IMAGE_VERSION) == 0);
43+
auto pl = parse_product_line(id);
44+
auto fv = get_available_firmware_version(pl);
45+
return !(fv == "");
4446
}
4547

4648
int parse_product_line(std::string id)
@@ -56,7 +58,7 @@ namespace rs2
5658

5759
if (product_line == RS2_PRODUCT_LINE_D400 && allow_rc_firmware) return FW_D4XX_RC_IMAGE_VERSION;
5860
else if (product_line == RS2_PRODUCT_LINE_D400) return FW_D4XX_FW_IMAGE_VERSION;
59-
else if (product_line == RS2_PRODUCT_LINE_SR300) return FW_SR3XX_FW_IMAGE_VERSION;
61+
//else if (product_line == RS2_PRODUCT_LINE_SR300) return FW_SR3XX_FW_IMAGE_VERSION;
6062
else return "";
6163
}
6264

@@ -437,7 +439,7 @@ namespace rs2
437439

438440
void fw_update_notification_model::draw_expanded(ux_window& win, std::string& error_message)
439441
{
440-
if (update_manager->started() && update_state == RS2_FWU_STATE_INITIAL_PROMPT)
442+
if (update_manager->started() && update_state == RS2_FWU_STATE_INITIAL_PROMPT)
441443
update_state = RS2_FWU_STATE_IN_PROGRESS;
442444

443445
auto flags = ImGuiWindowFlags_NoResize |
@@ -548,4 +550,4 @@ namespace rs2
548550

549551
pinned = true;
550552
}
551-
}
553+
}

common/fw-update-helper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace rs2
1212
std::map<int, std::vector<uint8_t>> create_default_fw_table();
1313
std::vector<int> parse_fw_version(const std::string& fw);
1414
bool is_upgradeable(const std::string& curr, const std::string& available);
15-
bool is_recommended_fw_available();
15+
bool is_recommended_fw_available(std::string version);
1616

1717
class firmware_update_manager : public process_manager
1818
{

common/model-views.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3030,8 +3030,10 @@ namespace rs2
30303030
n->snoozed = true;
30313031
}
30323032

3033-
viewer.not_model.add_notification(n);
3034-
related_notifications.push_back(n);
3033+
// NOTE: For now do not pre-emptively suggest auto-calibration
3034+
// TODO: Revert in later release
3035+
//viewer.not_model.add_notification(n);
3036+
//related_notifications.push_back(n);
30353037
}
30363038
}
30373039
}
@@ -4326,9 +4328,7 @@ namespace rs2
43264328
if (ImGui::IsItemHovered())
43274329
ImGui::SetTooltip("Install official signed firmware from file to the device");
43284330

4329-
if (is_recommended_fw_available() &&
4330-
((dev.supports(RS2_CAMERA_INFO_PRODUCT_LINE)) ||
4331-
(dev.query_sensors().size() && dev.query_sensors().front().supports(RS2_CAMERA_INFO_PRODUCT_LINE))))
4331+
if (dev.supports(RS2_CAMERA_INFO_PRODUCT_LINE) && is_recommended_fw_available(dev.get_info(RS2_CAMERA_INFO_PRODUCT_LINE)))
43324332
{
43334333
if (ImGui::Selectable("Install Recommended Firmware "))
43344334
{
@@ -4381,13 +4381,11 @@ namespace rs2
43814381

43824382
viewer.not_model.add_notification(n);
43834383
n->forced = true;
4384-
n->update_state = autocalib_notification_model::RS2_CALIB_STATE_CALIB_IN_PROCESS;
4384+
n->update_state = autocalib_notification_model::RS2_CALIB_STATE_SELF_INPUT;
43854385

43864386
for (auto&& n : related_notifications)
43874387
if (dynamic_cast<autocalib_notification_model*>(n.get()))
43884388
n->dismiss(false);
4389-
4390-
manager->start(n);
43914389
}
43924390
catch (const error& e)
43934391
{

0 commit comments

Comments
 (0)