1

我正在尝试使用Genicam参考实现访问 GigE 相机,方法是尝试查看在线资源和现有的现有资源(aravisharvesters)并使用每个 Genicam 兼容相机支持的​​SNFC遵循GenTL 标准。我目前使用的制片人来自 Basler,因为我这里的相机来自他们。

/* I wrapped the Genicam classes with my own. Here are the relevant parts */
tl = new GenicamTransportlayer("/opt/pylon/lib/gentlproducer/gtl/ProducerGEV.cti");
if0 = tl.getFirstInterface();
dev0 = if0.getFirstDevice();
ds = dev0.getFirstDataStream();

我能够连接到系统、接口、设备、数据流,连接节点映射,现在我正在尝试设置用于采集的缓冲区。为此,我需要从相机中获取最大有效载荷大小。GenTL 标准文档标准说,我需要从 DataStream 模块使用

boolean definesPayloadSize = ds.getInfoBool8(StreamInfoCommand.STREAM_INFO_DEFINES_PAYLOADSIZE);

这给了我0或假。生产者可以提供一个 PayloadSize 特性,可以使用它来查询

ds.getInfoSizet(StreamInfoCommand.STREAM_INFO_PAYLOAD_SIZE);

这显然也是 0 并且作为一个可能我不能依赖它。该标准进一步告诉我,如果两者都失败,我需要通过远程设备 NodeMap 查询以读取 PayloadSize:

long payloadSizeFromRemoteMap = dev0.remoteMap.getIntegerNode("PayloadSize").getValue();

这也给了我0。标准继续说,如果生产者没有实现接口标准(无论这意味着什么?),则必须使用 StreamInfo 命令通过生产者查询所需的有效负载大小,这也失败了(GenTL 将常量 STREAM_INFO_PAYLOAD_SIZE 映射到 7,这会产生系统端口上的 BufferTooSmallException)。

在这一点上,我很困惑该怎么做。我的大多数节点都被锁定(我可以覆盖 TLParamsLocked 但仍然无法更改参数,例如,执行默认参数集的加载)所以我无法设置 Width/Height/ImageFormat 来推断 PayloadSize:

/* Trying to set a default configuration fails  */
IEnumeration userSetSelector = dev0.remoteMap.getEnumerationNode("UserSetSelector");
log.debug("Loading Feature set: " + userSetSelector.getEntries().get(0).getName());
// Prints: Loading Feature set: EnumEntry_UserSetSelector_Default

userSetSelector.setValue("Default");
dev0.remoteMap.getCommandNode("UserSetLoad").execute();
// AccessException: Node is not writable. : AccessException thrown in node 'UserSetLoad' while calling 'UserSetLoad.Execute()' -  Node is not writable.

在不知道缓冲区大小的情况下,我无法继续。我如何推断 PayloadSize 来设置它们?

4

0 回答 0