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;
561 ret=p->GetCurrentEntry(
false, igncache)->GetValue();
563 if (vmin != 0) *vmin=ret;
564 if (vmax != 0) *vmax=ret;
572 ret=val->GetValue(
false, igncache);
574 if (vmin != 0) *vmin=val->GetMin();
575 if (vmax != 0) *vmax=val->GetMax();
579 throw std::invalid_argument(std::string(
"Feature not integer: ")+name);
585 throw std::invalid_argument(std::string(
"Feature not readable: ")+name);
590 throw std::invalid_argument(std::string(
"Feature not found: ")+name);
597 throw std::invalid_argument(ex.
what());
604 double getFloat(
const std::shared_ptr<GenApi::CNodeMapRef> &nodemap,
const char *name,
605 double *vmin,
double *vmax,
bool exception,
bool igncache)
609 if (vmin != 0) *vmin=0;
610 if (vmax != 0) *vmax=0;
624 ret=val->GetValue(
false, igncache);
626 if (vmin != 0) *vmin=val->GetMin();
627 if (vmax != 0) *vmax=val->GetMax();
631 throw std::invalid_argument(std::string(
"Feature not float: ")+name);
636 throw std::invalid_argument(std::string(
"Feature not readable: ")+name);
641 throw std::invalid_argument(std::string(
"Feature not found: ")+name);
648 throw std::invalid_argument(ex.
what());
655 std::string
getEnum(
const std::shared_ptr<GenApi::CNodeMapRef> &nodemap,
const char *name,
676 ret=entry->GetSymbolic();
680 throw std::invalid_argument(std::string(
"Current value is not defined: ")+name);
685 throw std::invalid_argument(std::string(
"Feature not enumeration: ")+name);
690 throw std::invalid_argument(std::string(
"Feature not readable: ")+name);
695 throw std::invalid_argument(std::string(
"Feature not found: ")+name);
702 throw std::invalid_argument(ex.
what());
709 std::string
getEnum(
const std::shared_ptr<GenApi::CNodeMapRef> &nodemap,
const char *name,
710 std::vector<std::string> &list,
bool exception)
729 val->GetSymbolics(entries);
731 for (
size_t i=0; i<entries.size(); i++)
733 list.push_back(std::string(entries[i]));
740 ret=entry->GetSymbolic();
744 throw std::invalid_argument(std::string(
"Current value is not defined: ")+name);
749 throw std::invalid_argument(std::string(
"Feature not enumeration: ")+name);
754 throw std::invalid_argument(std::string(
"Feature not readable: ")+name);
759 throw std::invalid_argument(std::string(
"Feature not found: ")+name);
766 throw std::invalid_argument(ex.
what());
773 std::string
getString(
const std::shared_ptr<GenApi::CNodeMapRef> &nodemap,
const char *name,
774 bool exception,
bool igncache)
786 switch (node->GetPrincipalInterfaceType())
791 out << p->GetValue(
false, igncache);
798 int64_t value=p->GetValue(
false, igncache);
800 switch (p->GetRepresentation())
803 out << std::hex << value;
807 out << ((value>>24)&0xff) <<
'.' << ((value>>16)&0xff) <<
'.' 808 << ((value>>8)&0xff) <<
'.' << (value&0xff);
812 out << std::hex << std::setfill(
'0');
813 out << std::setw(2) << ((value>>40)&0xff) <<
':' 814 << std::setw(2) << ((value>>32)&0xff) <<
':' 815 << std::setw(2) << ((value>>24)&0xff) <<
':' 816 << std::setw(2) << ((value>>16)&0xff) <<
':' 817 << std::setw(2) << ((value>>8)&0xff) <<
':' 818 << std::setw(2) << (value&0xff);
831 out << p->GetValue(
false, igncache);
838 out << p->GetCurrentEntry()->GetSymbolic();
845 out << p->GetValue(
false, igncache);
852 throw std::invalid_argument(std::string(
"Feature of unknown datatype: ")+name);
859 throw std::invalid_argument(std::string(
"Feature not readable: ")+name);
864 throw std::invalid_argument(std::string(
"Feature not found: ")+name);
871 throw std::invalid_argument(ex.
what());
878 void checkFeature(
const std::shared_ptr<GenApi::CNodeMapRef> &nodemap,
const char *name,
879 const char *value,
bool igncache)
881 std::string cvalue=
getString(nodemap, name,
true, igncache);
883 if (cvalue !=
"" && cvalue != value)
886 out << name <<
" == " << value <<
" expected: " << cvalue;
887 throw std::invalid_argument(out.
str());
891 std::shared_ptr<GenApi::CChunkAdapter>
getChunkAdapter(
const std::shared_ptr<GenApi::CNodeMapRef> &nodemap,
892 const std::string &tltype)
894 std::shared_ptr<GenApi::CChunkAdapter> chunkadapter;
896 if (
setBoolean(nodemap,
"ChunkModeActive",
true))
902 else if (tltype ==
"U3V")
916 const Buffer *buffer, uint32_t ipart)
918 std::string component;
927 if (sel != 0 && part != 0)
934 sel->GetEntries(list);
936 for (
size_t i=0; i<list.size() && component.size() == 0; i++)
942 sel->SetIntValue(entry->GetValue());
954 catch (
const std::exception &)
969 component=
"Intensity";
973 component=
"IntensityCombined";
978 component=
"Disparity";
982 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.
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IBoolean
Interface for Boolean properties.
GENICAM_INTERFACE IInteger
Interface for integer 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)
NOTE: This function is deprecated.
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.
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.
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT ICommand
Interface for command like properties.
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.
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IEnumeration
Interface for enumeration properties.
std::string getComponetOfPart(const std::shared_ptr< GenApi::CNodeMapRef > &nodemap, const Buffer *buffer, uint32_t ipart)
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.
GENICAM_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.
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IFloat
Interface for float properties.
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_INTERFACE INode
Interface common to all nodes.
GenICam's exception class.
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.
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IEnumEntry
Interface of single enum value.
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.
Declaration of the CChunkAdapterU3V class.
virtual const char * what() const
Get error description (overwrite from std:exception)