53 bool callCommand(
const std::shared_ptr<GenApi::CNodeMapRef> &nodemap,
const char *name,
75 throw std::invalid_argument(std::string(
"Feature not a command: ")+name);
80 throw std::invalid_argument(std::string(
"Feature not writable: ")+name);
85 throw std::invalid_argument(std::string(
"Feature not found: ")+name);
92 throw std::invalid_argument(ex.
what());
99 bool setBoolean(
const std::shared_ptr<GenApi::CNodeMapRef> &nodemap,
const char *name,
100 bool value,
bool exception)
116 val->SetValue(value);
121 throw std::invalid_argument(std::string(
"Feature not boolean: ")+name);
126 throw std::invalid_argument(std::string(
"Feature not writable: ")+name);
131 throw std::invalid_argument(std::string(
"Feature not found: ")+name);
138 throw std::invalid_argument(ex.
what());
145 bool setInteger(
const std::shared_ptr<GenApi::CNodeMapRef> &nodemap,
const char *name,
162 val->SetValue(value);
167 throw std::invalid_argument(std::string(
"Feature not integer: ")+name);
172 throw std::invalid_argument(std::string(
"Feature not writable: ")+name);
177 throw std::invalid_argument(std::string(
"Feature not found: ")+name);
184 throw std::invalid_argument(ex.
what());
191 bool setIPV4Address(
const std::shared_ptr<GenApi::CNodeMapRef> &nodemap,
const char *name,
192 const char *value,
bool exception)
210 std::stringstream in(value);
213 for (
int i=0; i<4; i++)
216 ip=(ip<<8)|(stoi(elem)&0xff);
224 throw std::invalid_argument(std::string(
"Feature not integer: ")+name);
229 throw std::invalid_argument(std::string(
"Feature not writable: ")+name);
234 throw std::invalid_argument(std::string(
"Feature not found: ")+name);
241 throw std::invalid_argument(ex.
what());
248 bool setFloat(
const std::shared_ptr<GenApi::CNodeMapRef> &nodemap,
const char *name,
249 double value,
bool exception)
265 val->SetValue(value);
270 throw std::invalid_argument(std::string(
"Feature not float: ")+name);
275 throw std::invalid_argument(std::string(
"Feature not writable: ")+name);
280 throw std::invalid_argument(std::string(
"Feature not found: ")+name);
287 throw std::invalid_argument(ex.
what());
294 bool setEnum(
const std::shared_ptr<GenApi::CNodeMapRef> &nodemap,
const char *name,
295 const char *value,
bool exception)
315 val->SetIntValue(entry->GetValue());
321 throw std::invalid_argument(std::string(
"Enumeration '")+name+
322 "' does not contain: "+value);
327 throw std::invalid_argument(std::string(
"Feature not enumeration: ")+name);
332 throw std::invalid_argument(std::string(
"Feature not writable: ")+name);
337 throw std::invalid_argument(std::string(
"Feature not found: ")+name);
344 throw std::invalid_argument(ex.
what());
351 bool setString(
const std::shared_ptr<GenApi::CNodeMapRef> &nodemap,
const char *name,
352 const char *value,
bool exception)
364 switch (node->GetPrincipalInterfaceType())
370 std::string v=std::string(value);
371 if (v ==
"true" || v ==
"True" || v ==
"TRUE")
375 else if (v ==
"false" || v ==
"False" || v ==
"FALSE")
381 p->SetValue(std::stoi(v));
390 switch (p->GetRepresentation())
393 p->SetValue(std::stoll(std::string(value), 0, 16));
400 std::stringstream in(value);
403 for (
int i=0; i<4; i++)
406 ip=(ip<<8)|(stoi(elem)&0xff);
417 std::stringstream in(value);
420 for (
int i=0; i<4; i++)
423 mac=(mac<<8)|(stoi(elem, 0, 16)&0xff);
431 p->SetValue(std::stoll(std::string(value)));
440 p->SetValue(std::stof(std::string(value)));
451 p->SetIntValue(entry->GetValue());
455 throw std::invalid_argument(std::string(
"Enumeration '")+name+
456 "' does not contain: "+value);
471 throw std::invalid_argument(std::string(
"Feature of unknown datatype: ")+name);
478 throw std::invalid_argument(std::string(
"Feature not writable: ")+name);
483 throw std::invalid_argument(std::string(
"Feature not found: ")+name);
490 throw std::invalid_argument(ex.
what());
497 bool getBoolean(
const std::shared_ptr<GenApi::CNodeMapRef> &nodemap,
const char *name,
498 bool exception,
bool igncache)
514 ret=val->GetValue(
false, igncache);
518 throw std::invalid_argument(std::string(
"Feature not boolean: ")+name);
523 throw std::invalid_argument(std::string(
"Feature not readable: ")+name);
528 throw std::invalid_argument(std::string(
"Feature not found: ")+name);
535 throw std::invalid_argument(ex.
what());
547 if (vmin != 0) *vmin=0;
548 if (vmax != 0) *vmax=0;
562 ret=val->GetValue(
false, igncache);
564 if (vmin != 0) *vmin=val->GetMin();
565 if (vmax != 0) *vmax=val->GetMax();
569 throw std::invalid_argument(std::string(
"Feature not integer: ")+name);
574 throw std::invalid_argument(std::string(
"Feature not readable: ")+name);
579 throw std::invalid_argument(std::string(
"Feature not found: ")+name);
586 throw std::invalid_argument(ex.
what());
593 double getFloat(
const std::shared_ptr<GenApi::CNodeMapRef> &nodemap,
const char *name,
594 double *vmin,
double *vmax,
bool exception,
bool igncache)
598 if (vmin != 0) *vmin=0;
599 if (vmax != 0) *vmax=0;
613 ret=val->GetValue(
false, igncache);
615 if (vmin != 0) *vmin=val->GetMin();
616 if (vmax != 0) *vmax=val->GetMax();
620 throw std::invalid_argument(std::string(
"Feature not float: ")+name);
625 throw std::invalid_argument(std::string(
"Feature not readable: ")+name);
630 throw std::invalid_argument(std::string(
"Feature not found: ")+name);
637 throw std::invalid_argument(ex.
what());
644 std::string
getEnum(
const std::shared_ptr<GenApi::CNodeMapRef> &nodemap,
const char *name,
665 ret=entry->GetSymbolic();
669 throw std::invalid_argument(std::string(
"Current value is not defined: ")+name);
674 throw std::invalid_argument(std::string(
"Feature not enumeration: ")+name);
679 throw std::invalid_argument(std::string(
"Feature not readable: ")+name);
684 throw std::invalid_argument(std::string(
"Feature not found: ")+name);
691 throw std::invalid_argument(ex.
what());
698 std::string
getEnum(
const std::shared_ptr<GenApi::CNodeMapRef> &nodemap,
const char *name,
699 std::vector<std::string> &list,
bool exception)
717 ret=val->GetCurrentEntry()->GetSymbolic();
720 val->GetSymbolics(entry);
722 for (
size_t i=0; i<entry.size(); i++)
724 list.push_back(std::string(entry[i]));
729 throw std::invalid_argument(std::string(
"Feature not enumeration: ")+name);
734 throw std::invalid_argument(std::string(
"Feature not readable: ")+name);
739 throw std::invalid_argument(std::string(
"Feature not found: ")+name);
746 throw std::invalid_argument(ex.
what());
753 std::string
getString(
const std::shared_ptr<GenApi::CNodeMapRef> &nodemap,
const char *name,
754 bool exception,
bool igncache)
766 switch (node->GetPrincipalInterfaceType())
771 out << p->GetValue(
false, igncache);
778 int64_t value=p->GetValue(
false, igncache);
780 switch (p->GetRepresentation())
783 out << std::hex << value;
787 out << ((value>>24)&0xff) <<
'.' << ((value>>16)&0xff) <<
'.' 788 << ((value>>8)&0xff) <<
'.' << (value&0xff);
792 out << std::hex << std::setfill(
'0');
793 out << std::setw(2) << ((value>>40)&0xff) <<
':' 794 << std::setw(2) << ((value>>32)&0xff) <<
':' 795 << std::setw(2) << ((value>>24)&0xff) <<
':' 796 << std::setw(2) << ((value>>16)&0xff) <<
':' 797 << std::setw(2) << ((value>>8)&0xff) <<
':' 798 << std::setw(2) << (value&0xff);
811 out << p->GetValue(
false, igncache);
818 out << p->GetCurrentEntry()->GetSymbolic();
825 out << p->GetValue(
false, igncache);
832 throw std::invalid_argument(std::string(
"Feature of unknown datatype: ")+name);
839 throw std::invalid_argument(std::string(
"Feature not readable: ")+name);
844 throw std::invalid_argument(std::string(
"Feature not found: ")+name);
851 throw std::invalid_argument(ex.
what());
858 void checkFeature(
const std::shared_ptr<GenApi::CNodeMapRef> &nodemap,
const char *name,
859 const char *value,
bool igncache)
863 if (cvalue !=
"" && cvalue != value)
866 out << name <<
" == " << value <<
" expected: " << cvalue;
867 throw std::invalid_argument(out.
str());
871 std::shared_ptr<GenApi::CChunkAdapter>
getChunkAdapter(
const std::shared_ptr<GenApi::CNodeMapRef> &nodemap,
872 const std::string &tltype)
874 std::shared_ptr<GenApi::CChunkAdapter> chunkadapter;
876 if (
setBoolean(nodemap,
"ChunkModeActive",
true))
882 else if (tltype ==
"U3V")
898 std::string component;
907 if (sel != 0 && part != 0)
914 sel->GetEntries(list);
916 for (
size_t i=0; i<list.size() && component.size() == 0; i++)
922 sel->SetIntValue(entry->GetValue());
934 catch (
const std::exception &)
949 component=
"Intensity";
953 component=
"IntensityCombined";
958 component=
"Disparity";
962 component=
"Confidence";
bool getBoolean(const std::shared_ptr< GenApi::CNodeMapRef > &nodemap, const char *name, bool exception, bool igncache)
Get the value of a boolean feature of the given nodemap.
bool setIPV4Address(const std::shared_ptr< GenApi::CNodeMapRef > &nodemap, const char *name, const char *value, bool exception)
Set the value of an integer feature of the given nodemap from an IP address.
Hex number in an edit control.
Connects a chunked DCAM buffer to a node map.
interface GENAPI_DECL_ABSTRACT IBoolean
Interface for Boolean properties.
std::istream & getline(std::istream &is, GENICAM_NAMESPACE::gcstring &str)
STL getline.
std::shared_ptr< GenApi::CChunkAdapter > getChunkAdapter(const std::shared_ptr< GenApi::CNodeMapRef > &nodemap, const std::string &tltype)
Sets ChunkModeActive to 1, creates a chunk adapter for the specified transport layer and attaches it ...
Declaration of the CChunkAdapterGeneric class.
int64_t getInteger(const std::shared_ptr< GenApi::CNodeMapRef > &nodemap, const char *name, int64_t *vmin, int64_t *vmax, bool exception, bool igncache)
Get the value of an integer feature of the given nodemap.
interface GENAPI_DECL_ABSTRACT IEnumeration
Interface for enumeration properties.
bool setFloat(const std::shared_ptr< GenApi::CNodeMapRef > &nodemap, const char *name, double value, bool exception)
Set the value of a float feature of the given nodemap.
virtual GENICAM_NAMESPACE::gcstring GetSymbolic() const =0
Get symbolic enum value.
bool IsReadable(EAccessMode AccessMode)
Tests if readable.
size_t getWidth(std::uint32_t part) const
Returns the width of the image in pixel.
bool setEnum(const std::shared_ptr< GenApi::CNodeMapRef > &nodemap, const char *name, const char *value, bool exception)
Set the value of an enumeration of the given nodemap.
interface GENAPI_DECL_ABSTRACT IInteger
Interface for integer properties.
interface GENAPI_DECL_ABSTRACT IFloat
Interface for float properties.
interface GENAPI_DECL_ABSTRACT IEnumEntry
Interface of single enum value.
The buffer class encapsulates a Genicam buffer that is provided by a stream.
Declaration of the CChunkAdapterGEV class.
node_vector NodeList_t
a list of node references
void checkFeature(const std::shared_ptr< GenApi::CNodeMapRef > &nodemap, const char *name, const char *value, bool igncache)
Checks the value of given feature and throws an exception in case of a mismatch.
std::string getEnum(const std::shared_ptr< GenApi::CNodeMapRef > &nodemap, const char *name, bool exception)
Get the value of an enumeration of the given nodemap.
uint64_t getPixelFormat(std::uint32_t part) const
Returns the pixel format of the specified part as defined in the PFNC.
interface GENAPI_DECL_ABSTRACT ICommand
Interface for command like properties.
bool setString(const std::shared_ptr< GenApi::CNodeMapRef > &nodemap, const char *name, const char *value, bool exception)
Set the value of a feature of the given nodemap.
bool setBoolean(const std::shared_ptr< GenApi::CNodeMapRef > &nodemap, const char *name, bool value, bool exception)
Set the value of a boolean feature of the given nodemap.
double getFloat(const std::shared_ptr< GenApi::CNodeMapRef > &nodemap, const char *name, double *vmin, double *vmax, bool exception, bool igncache)
Get the value of a double feature of the given nodemap.
bool callCommand(const std::shared_ptr< GenApi::CNodeMapRef > &nodemap, const char *name, bool exception)
Calls the given command.
Connects a generic chunked buffer to a node map.
interface GENAPI_DECL_ABSTRACT IString
Interface for string properties.
bool getImagePresent(std::uint32_t part) const
Returns if a 2D, 3D or confidence image is present in the specified part.
bool IsWritable(EAccessMode AccessMode)
Tests if writable.
bool setInteger(const std::shared_ptr< GenApi::CNodeMapRef > &nodemap, const char *name, int64_t value, bool exception)
Set the value of an integer feature of the given nodemap.
GenICam's exception class.
interface GENAPI_DECL_ABSTRACT INode
Interface common to all nodes.
GENICAM_NAMESPACE::gcstring_vector StringList_t
A list of strings.
size_t getHeight(std::uint32_t part) const
Returns the height of the image in pixel.
std::string getString(const std::shared_ptr< GenApi::CNodeMapRef > &nodemap, const char *name, bool exception, bool igncache)
Get the value of a feature of the given nodemap.
Connects a chunked U3V buffer to a node map.
std::string getComponetOfPart(const std::shared_ptr< GenApi::CNodeMapRef > &nodemap, const rcg::Buffer *buffer, uint32_t ipart)
Declaration of the CChunkAdapterU3V class.
virtual const char * what() const
Get error description (overwrite from std:exception)