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

Offset calculation is multiplicative in GenICam + Default for increment in Integer Nodes #186

Merged
merged 2 commits into from
Sep 28, 2024

Conversation

frankjannis
Copy link
Contributor

@frankjannis frankjannis commented Apr 23, 2024

  • Check test_all.sh is passed.
  • Add fix #{ISSUE_NUMBER} if the corresponding issue exists.
  • Fill out ## Changelog section. If the change is for only internal use, please write None to the section.

Changelog

Bugfix: The product of Offset and Index need to be added to the address for address offset calculations.
Bugfix: Default increment for Integer Nodes is 1.

@frankjannis
Copy link
Contributor Author

I just noted that #182 exists. As correctly stated there, this PR does not fix all the problems but at least fixes one of them...

@frankjannis frankjannis changed the title Offset calculation is multiplicative in GenICam Offset calculation is multiplicative in GenICam + Default for increment in Integer Nodes Apr 23, 2024
@Y-Nak Y-Nak self-requested a review April 24, 2024 20:41
@frankjannis
Copy link
Contributor Author

Hi! Something wrong with this PR or just currently too busy @Y-Nak :)?

@bschwind
Copy link
Contributor

bschwind commented Jul 4, 2024

Hey @frankjannis, thanks for the PR, and sorry I missed this! The fix looks good, but it would be great to add a test that fails on main and gets fixed with this PR to ensure the behavior going forward.

Also, there seem to be two independent fixes here? It might be good to split them out to separate PRs if you don't mind, unless they're truly both required for the fix to make sense.

We could also help to get the other fix in, related to using the length of the register when the offset is not specified.

@frankjannis
Copy link
Contributor Author

Hi @bschwind, thanks for responding! The 2 commits are indeed independent fixes and could be separated.
I currently don't have the time, to completely fix the behavior for the register lengths. Also, this repo does not seem that active anymore...

@bschwind
Copy link
Contributor

bschwind commented Jul 8, 2024

I currently don't have the time, to completely fix the behavior for the register lengths.

That's okay, I might take a crack at it and see what I come up with.

Also, this repo does not seem that active anymore...

It's true, but this crate is being used in several cameras running 24/7 capture and is quite stable, so there's not a lot of activity outside of bug fixes like this one.

@@ -45,7 +45,7 @@ impl Parse for IntegerNode {
let inc = node
.parse_if(INC, node_builder, value_builder, cache_builder)
.or_else(|| node.parse_if(P_INC, node_builder, value_builder, cache_builder))
.unwrap_or(ImmOrPNode::Imm(10));
.unwrap_or(ImmOrPNode::Imm(1));
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this is correct, but is there somewhere in the spec which states this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe this is correct, but is there somewhere in the spec which states this?

https://www.emva.org/wp-content/uploads/GenICam_Standard_v2_1_1.pdf
Page 51. There are the defaults stated.

Copy link
Contributor

@bschwind bschwind left a comment

Choose a reason for hiding this comment

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

LGTM! Sorry for taking so long on a simple change, I kind of let this one get lost in my inbox.

@bschwind bschwind merged commit a746684 into cameleon-rs:main Sep 28, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants