Skip to content
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

On-Chip Calibration Adjustments #4867

Merged
merged 4 commits into from
Sep 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions common/fw-update-helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ namespace rs2
RS2_FWU_STATE_FAILED = 3,
};

bool is_recommended_fw_available()
bool is_recommended_fw_available(std::string id)
{
return !(strcmp("", FW_D4XX_FW_IMAGE_VERSION) == 0);
auto pl = parse_product_line(id);
auto fv = get_available_firmware_version(pl);
return !(fv == "");
}

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

if (product_line == RS2_PRODUCT_LINE_D400 && allow_rc_firmware) return FW_D4XX_RC_IMAGE_VERSION;
else if (product_line == RS2_PRODUCT_LINE_D400) return FW_D4XX_FW_IMAGE_VERSION;
else if (product_line == RS2_PRODUCT_LINE_SR300) return FW_SR3XX_FW_IMAGE_VERSION;
//else if (product_line == RS2_PRODUCT_LINE_SR300) return FW_SR3XX_FW_IMAGE_VERSION;
else return "";
}

Expand Down Expand Up @@ -437,7 +439,7 @@ namespace rs2

void fw_update_notification_model::draw_expanded(ux_window& win, std::string& error_message)
{
if (update_manager->started() && update_state == RS2_FWU_STATE_INITIAL_PROMPT)
if (update_manager->started() && update_state == RS2_FWU_STATE_INITIAL_PROMPT)
update_state = RS2_FWU_STATE_IN_PROGRESS;

auto flags = ImGuiWindowFlags_NoResize |
Expand Down Expand Up @@ -548,4 +550,4 @@ namespace rs2

pinned = true;
}
}
}
2 changes: 1 addition & 1 deletion common/fw-update-helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace rs2
std::map<int, std::vector<uint8_t>> create_default_fw_table();
std::vector<int> parse_fw_version(const std::string& fw);
bool is_upgradeable(const std::string& curr, const std::string& available);
bool is_recommended_fw_available();
bool is_recommended_fw_available(std::string version);

class firmware_update_manager : public process_manager
{
Expand Down
14 changes: 6 additions & 8 deletions common/model-views.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3030,8 +3030,10 @@ namespace rs2
n->snoozed = true;
}

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

if (is_recommended_fw_available() &&
((dev.supports(RS2_CAMERA_INFO_PRODUCT_LINE)) ||
(dev.query_sensors().size() && dev.query_sensors().front().supports(RS2_CAMERA_INFO_PRODUCT_LINE))))
if (dev.supports(RS2_CAMERA_INFO_PRODUCT_LINE) && is_recommended_fw_available(dev.get_info(RS2_CAMERA_INFO_PRODUCT_LINE)))
{
if (ImGui::Selectable("Install Recommended Firmware "))
{
Expand Down Expand Up @@ -4381,13 +4381,11 @@ namespace rs2

viewer.not_model.add_notification(n);
n->forced = true;
n->update_state = autocalib_notification_model::RS2_CALIB_STATE_CALIB_IN_PROCESS;
n->update_state = autocalib_notification_model::RS2_CALIB_STATE_SELF_INPUT;

for (auto&& n : related_notifications)
if (dynamic_cast<autocalib_notification_model*>(n.get()))
n->dismiss(false);

manager->start(n);
}
catch (const error& e)
{
Expand Down
Loading