47 virtual bool Set(
double dVal) = 0;
48 virtual bool Set(
long lVal) = 0;
49 virtual bool Set(
const char* Val) = 0;
51 virtual bool Get(
double& dVal)
const = 0;
52 virtual bool Get(
long& lVal)
const = 0;
53 virtual bool Get(std::string& strVal)
const = 0;
59 virtual bool SetLimits(
double lowerLimit,
double upperLimit) = 0;
94 pObj_(pObj), fpt_(fpt) {}
98 {
return (*pObj_.*fpt_)(pProp, eAct);};
117 pObj_(pObj), fpt_(fpt), param_(data) {};
120 {
return (*pObj_.*fpt_)(pProp, eAct, param_);};
137 return func_(pProp, eAct);
203 bool GetData(
const char* value,
long& data)
const;
227 if (lowerLimit >= upperLimit)
345 bool Set(
double val);
347 bool Set(
const char* val);
349 bool Get(
double& val)
const;
350 bool Get(
long& val)
const ;
351 bool Get(std::string& val)
const;
374 for (
int i = 0; i < decimalPlaces_; ++i)
376 reciprocalMinimalStep_ = rms;
384 bool Set(
double val);
386 bool Set(
const char* val);
388 bool Get(
double& val)
const;
389 bool Get(
long& val)
const ;
390 bool Get(std::string& val)
const;
392 bool SetLimits(
double lowerLimit,
double upperLimit);
397 double Truncate(
double dVal);
398 double TruncateDown(
double dVal);
399 double TruncateUp(
double dVal);
402 double reciprocalMinimalStep_;
420 bool Set(
double val);
422 bool Set(
const char* val);
424 bool Get(
double& val)
const;
425 bool Get(
long& val)
const ;
426 bool Get(std::string& val)
const;
451 int Set(
const char* propName,
const char* Value);
452 int Get(
const char* propName, std::string& val)
const;
454 std::vector<std::string>
GetNames()
const;
456 bool GetName(
unsigned uIdx, std::string& strName)
const;
459 int Update(
const char* Name);
460 int Apply(
const char* Name);
463 typedef std::map<std::string, Property*> CPropArray;
464 CPropArray properties_;
#define DEVICE_SEQUENCE_TOO_LARGE
Definition MMDeviceConstants.h:86
#define DEVICE_ERR
Definition MMDeviceConstants.h:48
#define DEVICE_OK
Definition MMDeviceConstants.h:47
Extended device action implementation.
Definition Property.h:109
int Execute(MM::PropertyBase *pProp, MM::ActionType eAct)
Definition Property.h:119
~ActionEx()
Definition Property.h:118
ActionEx(T *pObj, int(T::*fpt)(PropertyBase *pProp, ActionType eAct, long data), long data)
Definition Property.h:116
Abstract interface to invoke specific action in the device.
Definition Property.h:76
virtual ~ActionFunctor()
Definition Property.h:78
virtual int Execute(PropertyBase *pProp, ActionType eAct)=0
Device action implementation.
Definition Property.h:87
int Execute(PropertyBase *pProp, ActionType eAct)
Definition Property.h:97
~Action()
Definition Property.h:95
Action(T *pObj, int(T::*fpt)(PropertyBase *pProp, ActionType eAct))
Definition Property.h:93
Action implementation using std::function to wrap arbitrary callables.
Definition Property.h:130
int Execute(PropertyBase *pProp, ActionType eAct) final
Definition Property.h:136
ActionLambda(F func)
Definition Property.h:134
Floating point property class (uses double type for value representation).
Definition Property.h:366
FloatProperty(const char *name)
Definition Property.h:368
bool SetLimits(double lowerLimit, double upperLimit)
Definition Property.cpp:200
PropertyType GetType()
Definition Property.h:381
bool Get(double &val) const
Definition Property.cpp:178
virtual ~FloatProperty()
Definition Property.h:379
bool Set(double val)
Definition Property.cpp:156
Integer property class.
Definition Property.h:409
bool Set(double val)
Definition Property.cpp:210
IntegerProperty(const char *name)
Definition Property.h:411
~IntegerProperty()
Definition Property.h:415
bool Get(double &val) const
Definition Property.cpp:231
PropertyType GetType()
Definition Property.h:417
Base API for all device properties.
Definition Property.h:39
virtual double GetLowerLimit() const =0
virtual int AddToSequence(const char *value)=0
virtual bool SetLimits(double lowerLimit, double upperLimit)=0
virtual bool Set(const char *Val)=0
virtual bool HasLimits() const =0
virtual void SetSequenceable(long sequenceSize)=0
virtual double GetUpperLimit() const =0
virtual ~PropertyBase()
Definition Property.h:41
virtual std::string GetName() const =0
virtual long GetSequenceMaxSize() const =0
virtual int SendSequence()=0
virtual bool Get(long &lVal) const =0
virtual std::vector< std::string > GetSequence() const =0
virtual bool Get(double &dVal) const =0
virtual bool Set(double dVal)=0
virtual int ClearSequence()=0
virtual bool Set(long lVal)=0
virtual PropertyType GetType()=0
virtual bool Get(std::string &strVal) const =0
An array of properties supported by a device.
Definition Property.h:438
bool GetName(unsigned uIdx, std::string &strName) const
Definition Property.cpp:436
int ClearAllowedValues(const char *name)
Definition Property.cpp:379
int UpdateAll()
Definition Property.cpp:459
int GetCurrentPropertyData(const char *name, long &data)
Definition Property.cpp:422
int GetPropertyData(const char *name, const char *value, long &data)
Definition Property.cpp:410
int RegisterAction(const char *name, ActionFunctor *fpAct)
Definition Property.cpp:448
std::vector< std::string > GetNames() const
Definition Property.cpp:313
int ApplyAll()
Definition Property.cpp:472
int AddAllowedValue(const char *name, const char *value, long data)
Definition Property.cpp:389
int Set(const char *propName, const char *Value)
Definition Property.cpp:266
int Get(const char *propName, std::string &val) const
Definition Property.cpp:289
~PropertyCollection()
Definition Property.cpp:259
int CreateProperty(const char *name, const char *value, PropertyType eType, bool bReadOnly, ActionFunctor *pAct=0, bool isPreInitProperty=false)
Definition Property.cpp:329
PropertyCollection()
Definition Property.cpp:255
int Update(const char *Name)
Definition Property.cpp:485
Property * Find(const char *name) const
Definition Property.cpp:305
int Apply(const char *Name)
Definition Property.cpp:494
int SetAllowedValues(const char *name, std::vector< std::string > &values)
Definition Property.cpp:366
unsigned GetSize() const
Definition Property.cpp:324
Property API with most of the Property mechanism implemented.
Definition Property.h:145
void SetCached(bool bState=true)
Definition Property.h:168
virtual ~Property()
Definition Property.h:162
double GetUpperLimit() const
Definition Property.h:215
bool GetReadOnly() const
Definition Property.h:170
void SetReadOnly(bool bState=true)
Definition Property.h:171
bool IsSequenceable()
Definition Property.h:236
long GetSequenceMaxSize() const
Definition Property.h:245
int ClearSequence()
Definition Property.h:250
void SetSequenceable(long sequenceMaxSize)
Definition Property.cpp:82
bool sequenceable_
Definition Property.h:319
long sequenceMaxSize_
Definition Property.h:320
int StopSequence()
Definition Property.h:305
std::vector< std::string > GetSequence() const
Definition Property.h:293
ActionFunctor * fpAction_
Definition Property.h:314
Property(const char *name)
Definition Property.h:147
int Update()
Definition Property.h:177
bool hasData_
Definition Property.h:316
bool readOnly_
Definition Property.h:313
double lowerLimit_
Definition Property.h:322
const std::string name_
Definition Property.h:325
bool cached_
Definition Property.h:315
bool IsAllowed(const char *value) const
Definition Property.cpp:55
std::map< std::string, long > values_
Definition Property.h:324
double upperLimit_
Definition Property.h:323
bool initStatus_
Definition Property.h:317
int Apply()
Definition Property.h:184
void AddAllowedValue(const char *value)
Definition Property.cpp:41
bool SetLimits(double lowerLimit, double upperLimit)
Definition Property.h:220
std::vector< std::string > sequenceEvents_
Definition Property.h:321
double GetLowerLimit() const
Definition Property.h:210
bool HasLimits() const
Definition Property.h:205
int AddToSequence(const char *value)
Definition Property.h:265
void SetInitStatus(bool init)
Definition Property.h:174
bool GetInitStatus() const
Definition Property.h:173
std::string GetName() const
Definition Property.h:288
void ClearAllowedValues()
Definition Property.h:195
std::vector< std::string > GetAllowedValues() const
Definition Property.cpp:32
int StartSequence()
Definition Property.h:298
bool GetData(const char *value, long &data) const
Definition Property.cpp:67
bool limits_
Definition Property.h:318
void RegisterAction(ActionFunctor *fpAction)
Definition Property.h:176
bool GetCached() const
Definition Property.h:167
int SendSequence()
Definition Property.h:280
String property class.
Definition Property.h:335
bool Set(double val)
Definition Property.cpp:93
bool Get(double &val) const
Definition Property.cpp:115
StringProperty(const char *name)
Definition Property.h:337
bool SetLimits(double, double)
Definition Property.h:353
PropertyType GetType()
Definition Property.h:342
virtual ~StringProperty()
Definition Property.h:340
Definition CameraImageMetadata.h:25
PropertyType
Definition MMDeviceConstants.h:258
@ Float
Definition MMDeviceConstants.h:261
@ String
Definition MMDeviceConstants.h:260
@ Integer
Definition MMDeviceConstants.h:262
ActionType
Definition MMDeviceConstants.h:265
@ IsSequenceable
Definition MMDeviceConstants.h:269
@ AfterSet
Definition MMDeviceConstants.h:268
@ StopSequence
Definition MMDeviceConstants.h:272
@ AfterLoadSequence
Definition MMDeviceConstants.h:270
@ StartSequence
Definition MMDeviceConstants.h:271
@ BeforeGet
Definition MMDeviceConstants.h:267