7#include <tabulate/table.hpp>
14std::map<FeaturePermissions, std::vector<NeoAPI::Feature*>>
17 std::map<internal::FeaturePermissions, std::vector<NeoAPI::Feature*>> featurePermissionsMap;
19 uint64_t featureCount = 0;
20 for(
auto& f : cam.GetFeatureList()) {
22 auto isAvailable = f.IsAvailable();
23 auto isReadable = f.IsReadable();
24 auto isWritable = f.IsWritable();
26 if(featurePermissionsMap.find(permissions) == featurePermissionsMap.cend()) {
27 featurePermissionsMap[permissions] = std::vector<NeoAPI::Feature*>();
29 featurePermissionsMap[permissions].push_back(&f);
34 for(
auto& [_, features] : featurePermissionsMap)
37 std::sort(features.begin(), features.end(), [](NeoAPI::Feature* a, NeoAPI::Feature* b) {
38 return std::string(a->GetName()) < std::string(b->GetName());
43 return featurePermissionsMap;
49 const auto& featurePermissionsMap =
51 tabulate::Table table;
52 table.add_row({
"Feature Name",
"Available",
"Readable",
"Writable"});
54 for(
const auto& [permissions, features] : featurePermissionsMap) {
55 for(
const auto* feature : features) {
56 table.add_row({feature->GetName().c_str(),
57 permissions.isAvailable() ?
"yes" :
"no",
58 permissions.isReadable() ?
"yes" :
"no",
59 permissions.isWritable() ?
"yes" :
"no"});
64 table.column(0).format().font_align(tabulate::FontAlign::right);
65 table.column(1).format().font_align(tabulate::FontAlign::center);
66 table.column(2).format().font_align(tabulate::FontAlign::center);
67 table.column(3).format().font_align(tabulate::FontAlign::center);
High-level wrapper around the NeoAPI camera for synchronized access.
NeoAPI::Cam & getNeoCam()
Access the underlying NeoAPI camera instance.
Utility function for discovering the features that are available in a camera.
#define IRSOL_LOG_INFO(...)
Logs an info-level message using the default logger.
#define IRSOL_LOG_TRACE(...)
Logs a trace-level message using the default logger.
Logging utilities and configuration for the irsol library.
Common portability and diagnostic macros for the irsol library.
#define IRSOL_SUPPRESS_UNUSED_STRUCTURED_BINDING_START
Begins a diagnostic suppression block for unused structured binding variables.
#define IRSOL_SUPPRESS_UNUSED_STRUCTURED_BINDING_END
Ends a diagnostic suppression block started with IRSOL_SUPPRESS_UNUSED_STRUCTURED_BINDING_START.
std::map< FeaturePermissions, std::vector< NeoAPI::Feature * > > extractCameraFeatures(NeoAPI::Cam &cam)
Extracts and groups camera features by their permissions.
std::string discoverCameraFeatures(Interface &cam)
Discovers all camera features and their permissions.
Encapsulates the permissions of a camera feature.