Skip to content

Commit

Permalink
PR #8811 from Nir: Remove online updates from DQT
Browse files Browse the repository at this point in the history
  • Loading branch information
maloel authored Apr 13, 2021
2 parents fbb09f7 + e0ae365 commit bce3075
Showing 1 changed file with 50 additions and 51 deletions.
101 changes: 50 additions & 51 deletions common/model-views.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3710,64 +3710,60 @@ namespace rs2

void device_model::check_for_bundled_fw_update(const rs2::context &ctx, std::shared_ptr<notifications_model> not_model)
{
// Inhibit for DQT
if( _allow_remove )
if( dev.supports( RS2_CAMERA_INFO_FIRMWARE_VERSION )
&& dev.supports( RS2_CAMERA_INFO_RECOMMENDED_FIRMWARE_VERSION )
&& dev.supports( RS2_CAMERA_INFO_PRODUCT_LINE ) )
{
if( dev.supports( RS2_CAMERA_INFO_FIRMWARE_VERSION )
&& dev.supports( RS2_CAMERA_INFO_RECOMMENDED_FIRMWARE_VERSION )
&& dev.supports( RS2_CAMERA_INFO_PRODUCT_LINE ) )
{
std::string fw = dev.get_info( RS2_CAMERA_INFO_FIRMWARE_VERSION );
std::string recommended
= dev.get_info( RS2_CAMERA_INFO_RECOMMENDED_FIRMWARE_VERSION );
std::string fw = dev.get_info( RS2_CAMERA_INFO_FIRMWARE_VERSION );
std::string recommended
= dev.get_info( RS2_CAMERA_INFO_RECOMMENDED_FIRMWARE_VERSION );

int product_line
= parse_product_line( dev.get_info( RS2_CAMERA_INFO_PRODUCT_LINE ) );
int product_line
= parse_product_line( dev.get_info( RS2_CAMERA_INFO_PRODUCT_LINE ) );

bool allow_rc_firmware = config_file::instance().get_or_default(
configurations::update::allow_rc_firmware,
false );
bool is_rc = ( product_line == RS2_PRODUCT_LINE_D400 ) && allow_rc_firmware;
std::string available = get_available_firmware_version( product_line );
bool allow_rc_firmware = config_file::instance().get_or_default(
configurations::update::allow_rc_firmware,
false );
bool is_rc = ( product_line == RS2_PRODUCT_LINE_D400 ) && allow_rc_firmware;
std::string available = get_available_firmware_version( product_line );

std::shared_ptr< firmware_update_manager > manager = nullptr;
std::shared_ptr< firmware_update_manager > manager = nullptr;

if( is_upgradeable( fw, available ) )
{
recommended = available;
if( is_upgradeable( fw, available ) )
{
recommended = available;

static auto table = create_default_fw_table();
static auto table = create_default_fw_table();

manager = std::make_shared< firmware_update_manager >( not_model,
*this,
dev,
ctx,
table[product_line],
true );
}
manager = std::make_shared< firmware_update_manager >( not_model,
*this,
dev,
ctx,
table[product_line],
true );
}

if( is_upgradeable( fw, recommended ) )
{
auto dev_name = get_device_name( dev );
std::stringstream msg;
msg << dev_name.first << " (S/N " << dev_name.second << ")\n"
<< "Current Version: " << fw << "\n";
if( is_upgradeable( fw, recommended ) )
{
auto dev_name = get_device_name( dev );
std::stringstream msg;
msg << dev_name.first << " (S/N " << dev_name.second << ")\n"
<< "Current Version: " << fw << "\n";

if( is_rc )
msg << "Release Candidate: " << recommended << " Pre-Release";
else
msg << "Recommended Version: " << recommended;

auto n = std::make_shared< fw_update_notification_model >( msg.str(),
manager,
false );
n->delay_id = "dfu." + dev_name.second;
n->enable_complex_dismiss = true;
if( ! n->is_delayed() )
{
not_model->add_notification( n );
related_notifications.push_back( n );
}
if( is_rc )
msg << "Release Candidate: " << recommended << " Pre-Release";
else
msg << "Recommended Version: " << recommended;

auto n = std::make_shared< fw_update_notification_model >( msg.str(),
manager,
false );
n->delay_id = "dfu." + dev_name.second;
n->enable_complex_dismiss = true;
if( ! n->is_delayed() )
{
not_model->add_notification( n );
related_notifications.push_back( n );
}
}
}
Expand All @@ -3779,7 +3775,9 @@ namespace rs2

auto name = get_device_name(dev);

check_for_device_updates(viewer);
// Inhibit on DQT
if ( _allow_remove )
check_for_device_updates(viewer);

if ((bool)config_file::instance().get(configurations::update::recommend_calibration))
{
Expand Down Expand Up @@ -4914,7 +4912,7 @@ namespace rs2
sw_update::dev_updates_profile updates_profile( dev, server_url, use_local_file );

bool sw_online_update_available = updates_profile.retrieve_updates( sw_update::LIBREALSENSE );
bool fw_online_update_available = updates_profile.retrieve_updates(sw_update::FIRMWARE );
bool fw_online_update_available = updates_profile.retrieve_updates( sw_update::FIRMWARE );

if (sw_online_update_available || fw_online_update_available)
{
Expand Down Expand Up @@ -5341,6 +5339,7 @@ namespace rs2
|| n->is< sw_recommended_update_alert_model >() )
n->dismiss( false ); // No need for snooze, if needed a new notification will be popped
}

check_for_device_updates( viewer );
}
}
Expand Down

0 comments on commit bce3075

Please sign in to comment.