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

Chunk feature access #912

Draft
wants to merge 2 commits into
base: aravis-0-8
Choose a base branch
from
Draft

Conversation

EmmanuelP
Copy link
Contributor

chunkparser: allow to set string and integer features

On some devices, chunk access requires a change of a local feature value. For
example:

 <Enumeration NameSpace="Standard" Name="ChunkComponentSelector">
  <Visibility>Expert</Visibility>
  <EnumEntry NameSpace="Standard" Name="Range">
   <Value>0</Value>
  </EnumEntry>
  <EnumEntry NameSpace="Standard" Name="Normal">
   <Value>1</Value>
  </EnumEntry>
  <EnumEntry NameSpace="Standard" Name="Texture">
   <Value>2</Value>
  </EnumEntry>
  <Value>0</Value>
 </Enumeration>

  <Float NameSpace="Standard" Name="ChunkScan3dCoordinateOffset">
  <Visibility>Expert</Visibility>
  <ImposedAccessMode>RO</ImposedAccessMode>
  <pValue>ChunkScan3dCoordinateOffsetRegister</pValue>
  <Min>-3.40282e+38</Min>
  <Max>3.40282e+38</Max>
  <Inc>1e-6</Inc>
  <DisplayPrecision>6</DisplayPrecision>
 </Float>

 <FloatReg NameSpace="Custom" Name="ChunkScan3dCoordinateOffsetRegister">
  <Visibility>Expert</Visibility>
  <Address>0x8</Address>
  <pIndex Offset="16">ChunkComponentSelector</pIndex>
  <Length>8</Length>
  <AccessMode>RW</AccessMode>
  <pPort>Chunk</pPort>
  <pInvalidator>ChunkScan3dCoordinateSelector</pInvalidator>
  <pInvalidator>ChunkComponentSelector</pInvalidator>
  <Endianess>LittleEndian</Endianess>
 </FloatReg>

As the Genicam tree is owned by the parser and not shared with the device, in
order to access to chunk data without a device instance, we need to provide an
API to set the selector feature.

arv_chunk_parser_set_string_feature_value (parser,
					   "ChunkComponentSelector",
					   "Normal", &error);
normal_offset = arv_chunk_parser_get_float_value (parser,
						  "ChunkScan3dCoordinateOffset",
						  &error);

On some devices, chunk access requires a change of a local feature value. For
example:

```
 <Enumeration NameSpace="Standard" Name="ChunkComponentSelector">
  <Visibility>Expert</Visibility>
  <EnumEntry NameSpace="Standard" Name="Range">
   <Value>0</Value>
  </EnumEntry>
  <EnumEntry NameSpace="Standard" Name="Normal">
   <Value>1</Value>
  </EnumEntry>
  <EnumEntry NameSpace="Standard" Name="Texture">
   <Value>2</Value>
  </EnumEntry>
  <Value>0</Value>
 </Enumeration>

  <Float NameSpace="Standard" Name="ChunkScan3dCoordinateOffset">
  <Visibility>Expert</Visibility>
  <ImposedAccessMode>RO</ImposedAccessMode>
  <pValue>ChunkScan3dCoordinateOffsetRegister</pValue>
  <Min>-3.40282e+38</Min>
  <Max>3.40282e+38</Max>
  <Inc>1e-6</Inc>
  <DisplayPrecision>6</DisplayPrecision>
 </Float>

 <FloatReg NameSpace="Custom" Name="ChunkScan3dCoordinateOffsetRegister">
  <Visibility>Expert</Visibility>
  <Address>0x8</Address>
  <pIndex Offset="16">ChunkComponentSelector</pIndex>
  <Length>8</Length>
  <AccessMode>RW</AccessMode>
  <pPort>Chunk</pPort>
  <pInvalidator>ChunkScan3dCoordinateSelector</pInvalidator>
  <pInvalidator>ChunkComponentSelector</pInvalidator>
  <Endianess>LittleEndian</Endianess>
 </FloatReg>
```

As the Genicam tree is owned by the parser and not shared with the device, in
order to access to chunk data without a device instance, we need to provide an
API to set the selector feature.

```
arv_chunk_parser_set_string_feature_value (parser,
					   "ChunkComponentSelector",
					   "Normal", &error);
normal_offset = arv_chunk_parser_get_float_value (parser,
						  "ChunkScan3dCoordinateOffset",
						  &error);
```
@EmmanuelP EmmanuelP changed the base branch from main to aravis-0-8 July 12, 2024 05:35
@EmmanuelP EmmanuelP marked this pull request as draft November 5, 2024 16:04
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.

1 participant