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

power line freq option with hardcoded range #12813

Merged
merged 2 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 4 additions & 0 deletions src/ds/d500/d500-options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,8 @@ namespace librealsense

return temperature;
}

power_line_freq_option::power_line_freq_option(const std::weak_ptr< uvc_sensor >& ep, rs2_option id,
const std::map< float, std::string >& description_per_value) :
uvc_pu_option(ep, id, description_per_value) {}
}
15 changes: 15 additions & 0 deletions src/ds/d500/d500-options.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "ds/ds-private.h"
#include "core/options-container.h"
#include "option.h"
#include "platform/uvc-option.h"

#include <rsutils/lazy.h>

Expand Down Expand Up @@ -74,4 +75,18 @@ namespace librealsense
temperature_component _component;
const char* _description;
};

class power_line_freq_option : public uvc_pu_option
{
public:
explicit power_line_freq_option(const std::weak_ptr< uvc_sensor >& ep, rs2_option id,
const std::map< float, std::string >& description_per_value);

virtual option_range get_range() const override
{
// this range had to be harcoded to avoid collisions with linux patches
// which have been upstreamed for d400 devices
return { 0.f /*min*/, 2.f /*max*/, 1.f /*step*/, 0.f /*default*/ };
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to make it a lazy when we query the range from PU and only override the min/max?

I think it will be better since each camera can have a different default, here we are forcing it.
Thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds great!

}
};
}
Loading