Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
Change-Id: Idc275350cb99478a46da35f967dd5e1b0124bb15
  • Loading branch information
ev-mp committed Sep 22, 2019
2 parents ff2a291 + c1c97e9 commit b54f47b
Show file tree
Hide file tree
Showing 38 changed files with 697 additions and 225 deletions.
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

0 comments on commit b54f47b

Please sign in to comment.