-
Notifications
You must be signed in to change notification settings - Fork 3
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
[Proposal] Rework Camera Properties #49
Comments
Commented on the gist https://gist.github.com/jangernert/1652e43c074c4338faf5f1b65a1912b2 |
@f00f
And here is a parameter which has a constraint for its range:
|
Working on the RealSense2 implementation in MetriCam2 and using the MetriCam2.Controls I noticed a few things that in my opinion could be improved.
ListParameters
are stored as a list of strings instead of their actual typePoint2i(1920,1080)
for resolution to a string representation like1920x1080
).ListParameter<Point2i>
as well but defines its allowed values as strings looking like(32;27)
instead?)So the basic suggestion I want to make is:
ListProperty
available as its native type. So a value can easily be checked for validity without crazy conversions.ToString
function that can convert the value for usage in the UI. Of course with a basic overwriteable default implementation that should fit most use cases. More complex situations like the above mentioned resolution can simply overwrite it.I hope so far everyone agrees with me.
Now to a rough prototype how I imagine things could be done. First off how you would currently define a
RangeProperty
:Compared to how I think it could work:
Here is the complete code of the little prototype I wrote:
Gist
@stephenmartindale mentioned we maybe could use attributes to achieve the functionality we want. Although I knew attributes existed, I never realized you could define your own. So I just had a rough look at some of the docs, but haven't figured out all the details of how we would implement everything with attributes yet.
The text was updated successfully, but these errors were encountered: