-
-
Notifications
You must be signed in to change notification settings - Fork 333
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
Viewer/accept zero exposuretime #821
Viewer/accept zero exposuretime #821
Conversation
It would be clearer and simpler to clamp the minimum exposure value returned by arv_camera_get_exposure_time_bounds here: Line 729 in 73a4ec4
|
It would event better to get back to a linear progression if minimum exposure time is <= 0 |
As a bonus, you may also use the Representation property of ExposureTime. It is explained page 33 of the Genicam specification: https://www.emva.org/wp-content/uploads/GenICam_Standard_v2_1_1.pdf |
@EmmanuelP Hi, thanks for the feedback and the info of Representation #821 (comment) I have updated gtk widget as follows:
I was not sure in the case of Undefined (-1), so I tentatively enabled both widgets. Please let me know if they are supposed to be disabled. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the pull request. The comments are mainly coding style issues. Please fix them an I'll merge the changes.
src/arvcamera.c
Outdated
*/ | ||
|
||
ArvGcRepresentation | ||
arv_camera_get_representation_gain (ArvCamera *camera, GError **error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rename this function to arv_camera_get_gain_representation()
Remove the error placeholder. Errors are for communication problems, not programming errors. get_representation comes directly from the xml data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated in b9c1305
src/arvcamera.c
Outdated
*/ | ||
|
||
ArvGcRepresentation | ||
arv_camera_get_representation_exposure_time (ArvCamera *camera, GError **error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename this function to arv_camera_get_exposure_time_representation()
Remove the error placeholder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated in b9c1305
src/arvcamera.c
Outdated
{ | ||
ArvCameraPrivate *priv = arv_camera_get_instance_private (camera); | ||
|
||
g_return_val_if_fail (ARV_IS_CAMERA (camera), FALSE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Type mismatch, return REPRESENTATION_UNDEFINED instead, and update the doc accordingly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in 17a2454
src/arvcamera.c
Outdated
{ | ||
ArvCameraPrivate *priv = arv_camera_get_instance_private (camera); | ||
|
||
g_return_val_if_fail (ARV_IS_CAMERA (camera), FALSE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Type mismatch, return REPRESENTATION_UNDEFINED instead, and update the doc accordingly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in 17a2454
* Since: | ||
*/ | ||
|
||
ArvGcRepresentation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the error placeholder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated in b9c1305
viewer/arvviewer.c
Outdated
// gtk_range_set_range (GTK_RANGE (viewer->exposure_hscale), 0.0, 1.0); | ||
// gtk_range_set_range (GTK_RANGE (viewer->gain_hscale), viewer->gain_min, viewer->gain_max); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't leave commented code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated in 1fd760c
viewer/arvviewer.c
Outdated
gint gain_representation; | ||
gint exposure_time_representation; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong type, use ArvGcRepresentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated in c5ccba1
viewer/arvviewer.c
Outdated
gtk_widget_set_sensitive (viewer->gain_hscale, is_gain_available); | ||
gtk_widget_set_sensitive (viewer->gain_spin_button, is_gain_available); | ||
if (is_gain_available){ | ||
viewer->gain_representation = (gint)(arv_camera_get_representation_gain(viewer->camera, NULL)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the cast to gint
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated in c5ccba1
viewer/arvviewer.c
Outdated
gtk_widget_set_sensitive (viewer->exposure_hscale, is_exposure_available); | ||
gtk_widget_set_sensitive (viewer->exposure_spin_button, is_exposure_available); | ||
if (is_exposure_available){ | ||
viewer->exposure_time_representation = (gint)(arv_camera_get_representation_exposure_time(viewer->camera, NULL)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the cast to gint
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated in c5ccba1
viewer/arvviewer.c
Outdated
@@ -749,17 +767,66 @@ set_camera_widgets(ArvViewer *viewer) | |||
string = g_strdup_printf ("%g", arv_camera_get_frame_rate (viewer->camera, NULL)); | |||
gtk_entry_set_text (GTK_ENTRY (viewer->frame_rate_entry), string); | |||
|
|||
// enables gtk widget based on feature representation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the comment, the code is self explanatory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated in 1fd760c
Thanks a lot. I have merged your changes with some minor fixes. I may revert the widget selection based on representation though, at least for exposure time, as it looks like most of the time it is defined as linear, while logarithmic makes more sense. |
Current arv-viewer accepts
>= 1.0
ExposureTime
, while GenICam defines its value is>= 0
.This disables the slider when the minimum of
ExposureTime
is less than 0, so I shifted the value +1.0 so that it makes log10(min) more than or equal to 0.Reference: https://www.emva.org/wp-content/uploads/GenICam_SFNC_v2_7.pdf