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
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion genapi/src/elem_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ impl RegPIndex {
let base = self.p_index.value(device, store, cx)?;
if let Some(offset) = &self.offset {
let offset: i64 = offset.value(device, store, cx)?;
Ok(base + offset)
Ok(base * offset)
} else {
Ok(base)
}
Expand Down
2 changes: 1 addition & 1 deletion genapi/src/parser/integer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.

let unit = node.parse_if(UNIT, node_builder, value_builder, cache_builder);
let representation: IntegerRepresentation = node
.parse_if(REPRESENTATION, node_builder, value_builder, cache_builder)
Expand Down
Loading