9#include <cvb/device_factory.hpp>
10#include <cvb/global.hpp>
11#include <cvb/driver/image_stream.hpp>
13static const constexpr int DELIVERABLE_COUNT = 10;
21 Cvb::DiscoverFlags::IncludeMockTL
26 for (
auto n = 0; (n < infoList.size()) && accessToken.empty(); ++n)
27 if (infoList.at(n).AccessToken().find(
"MockTL") != std::string::npos)
28 accessToken = infoList.at(n).AccessToken();
30 if (accessToken.empty())
34 auto device = Cvb::DeviceFactory::Open<Cvb::GenICamDevice>(accessToken, Cvb::AcquisitionStack::GenTL);
40 for (
auto m = 0; m < DELIVERABLE_COUNT; ++m)
50 auto deliverable = std::get<Cvb::MultiPartImagePtr>(waitResult);
53 for (
auto n = 0; n < deliverable->NumParts(); ++n)
55 auto item = deliverable->GetPartAt(n);
56 if (Cvb::holds_alternative<Cvb::ImagePtr>(item))
58 auto& image = Cvb::get<Cvb::ImagePtr>(item);
59 std::cout <<
"Image property: Part index: " << n <<
", Width : " << image->Width()
60 <<
", Height : " << image->Height()<<
", ";
64 auto& enumerator = std::get<Cvb::NodeMapEnumerator>(waitResult);
65 const auto names = enumerator.Names();
66 if (std::all_of(names.begin(), names.end(), [](
const Cvb::String& name) { return name !=
"VinBuffer"; }))
67 throw std::runtime_error(
"The nodemap enumerator of this container does not contain a VinBuffer node map.");
68 auto nodeMap = enumerator.NodeMap(CVB_LIT(
"VinBuffer"));
70 auto isIncompleteNode = nodeMap->TryGetNode<
Cvb::BooleanNode>(CVB_LIT(
"IsIncomplete"));
71 std::cout <<
"IsIncomplete: " << isIncompleteNode->Value() <<
", ";
73 auto frameIDNode = nodeMap->TryGetNode<
Cvb::IntegerNode>(CVB_LIT(
"FrameID"));
74 std::cout <<
"FrameID: " << frameIDNode->Value() <<
", ";
76 auto sizeFilledNode = nodeMap->TryGetNode<
Cvb::IntegerNode>(CVB_LIT(
"SizeFilled"));
77 std::cout <<
"SizeFilled: " << sizeFilledNode->Value() <<
", ";
80 std::cout <<
"Width: " << widthNode->Value() <<
", ";
83 std::cout <<
"Height: " << heightNode->Value() <<
", ";
85 auto xPaddingNode = nodeMap->TryGetNode<
Cvb::IntegerNode>(CVB_LIT(
"XPadding"));
86 std::cout <<
"XPadding: " << xPaddingNode->Value() <<
", ";
88 auto yPaddingNode = nodeMap->TryGetNode<
Cvb::IntegerNode>(CVB_LIT(
"YPadding"));
89 std::cout <<
"YPadding: " << yPaddingNode->Value() <<
", ";
91 auto timestampNode = nodeMap->TryGetNode<
Cvb::IntegerNode>(CVB_LIT(
"Timestamp"));
92 std::cout <<
"Timestamp: " << timestampNode->Value()<<std::endl;
static std::vector< DiscoveryInformation > Discover()
Discovers available devices (not vins) with a default time span of 300ms.
Definition: decl_device_factory.hpp:221
void Start() override
Starts the acquisition.
Definition: decl_composite_stream_base.hpp:349
Streams images.
Definition: image_stream.hpp:20
Node representing a true / false value.
Definition: boolean_node.hpp:19
Represents a integer number.
Definition: integer_node.hpp:20
@ Timeout
A timeout occurred, no image buffer has been returned.