YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
IFrameGrabberControlsMock Class Reference

Mocking class created to replace the grabber object. More...

#include </home/runner/work/yarp-documentation/yarp-documentation/yarp/opt-modules/yarp-device-ultrapython/src/devices/ultrapython/unittest/CliMock.h>

+ Inheritance diagram for IFrameGrabberControlsMock:

Public Member Functions

 MOCK_METHOD (bool, setFeature,(int, double),(override))
 
 MOCK_METHOD (bool, getFeature,(int, double *),(override))
 
bool getCameraDescription (CameraDescriptor *camera) override
 Get a basic description of the camera hw.
 
bool hasFeature (int feature, bool *hasFeature) override
 Check if camera has the requested feature (saturation, brightness ... )
 
bool setFeature (int feature, double value1, double value2) override
 Set the requested feature to a value using 2 params (like white balance)
 
bool getFeature (int feature, double *value1, double *value2) override
 Get the current value for the requested feature.
 
bool hasOnOff (int feature, bool *HasOnOff) override
 Check if the camera has the ability to turn on/off the requested feature.
 
bool setActive (int feature, bool onoff) override
 Set the requested feature on or off.
 
bool getActive (int feature, bool *isActive) override
 Get the current status of the feature, on or off.
 
bool hasAuto (int feature, bool *hasAuto) override
 Check if the requested feature has the 'auto' mode.
 
bool hasManual (int feature, bool *hasManual) override
 Check if the requested feature has the 'manual' mode.
 
bool hasOnePush (int feature, bool *hasOnePush) override
 Check if the requested feature has the 'onePush' mode.
 
bool setMode (int feature, FeatureMode mode) override
 Set the requested mode for the feature.
 
bool getMode (int feature, FeatureMode *mode) override
 Get the current mode for the feature.
 
bool setOnePush (int feature) override
 Set the requested feature to a value (saturation, brightness ... )
 
- Public Member Functions inherited from yarp::dev::IFrameGrabberControls
virtual ~IFrameGrabberControls ()
 Destructor.
 
std::string busType2String (BusType type)
 
FeatureMode toFeatureMode (bool _auto)
 
virtual bool setFeature (int feature, double value)=0
 Set the requested feature to a value (saturation, brightness ... )
 
virtual bool getFeature (int feature, double *value)=0
 Get the current value for the requested feature.
 

Detailed Description

Mocking class created to replace the grabber object.

Definition at line 28 of file CliMock.h.

Member Function Documentation

◆ getActive()

bool IFrameGrabberControlsMock::getActive ( int  feature,
bool *  isActive 
)
inlineoverridevirtual

Get the current status of the feature, on or off.

Parameters
featurethe identifier of the feature to check
isActiveflag true if the feature is active, false otherwise
Returns
returns true if success, false otherwise (e.g. the interface is not implemented)

Implements yarp::dev::IFrameGrabberControls.

Definition at line 43 of file CliMock.h.

◆ getCameraDescription()

bool IFrameGrabberControlsMock::getCameraDescription ( CameraDescriptor camera)
inlineoverridevirtual

Get a basic description of the camera hw.

This is mainly used to determine the HW bus type in order to choose the corresponding interface for advanced controls.

Parameters
devicereturns an identifier for the bus
Returns
returns true if success, false otherwise (e.g. the interface is not implemented)

Implements yarp::dev::IFrameGrabberControls.

Definition at line 33 of file CliMock.h.

◆ getFeature()

bool IFrameGrabberControlsMock::getFeature ( int  feature,
double *  value1,
double *  value2 
)
inlineoverridevirtual

Get the current value for the requested feature.

Parameters
featurethe identifier of the feaature to read
value1returns the current value of the feature, from 0 to 1 expressed as a percentage
value2returns the current value of the feature, from 0 to 1 expressed as a percentage
Returns
returns true on success, false on failure.

Implements yarp::dev::IFrameGrabberControls.

Definition at line 38 of file CliMock.h.

◆ getMode()

bool IFrameGrabberControlsMock::getMode ( int  feature,
FeatureMode mode 
)
inlineoverridevirtual

Get the current mode for the feature.

Parameters
featurethe identifier of the feature to change
hasAutoflag true if the feature is has 'auto' mode, false otherwise
Returns
returns true if success, false otherwise (e.g. the interface is not implemented)

Implements yarp::dev::IFrameGrabberControls.

Definition at line 48 of file CliMock.h.

◆ hasAuto()

bool IFrameGrabberControlsMock::hasAuto ( int  feature,
bool *  hasAuto 
)
inlineoverridevirtual

Check if the requested feature has the 'auto' mode.

Parameters
featurethe identifier of the feature to check
hasAutoflag true if the feature is has 'auto' mode, false otherwise
Returns
returns true if success, false otherwise (e.g. the interface is not implemented)

Implements yarp::dev::IFrameGrabberControls.

Definition at line 44 of file CliMock.h.

◆ hasFeature()

bool IFrameGrabberControlsMock::hasFeature ( int  feature,
bool *  hasFeature 
)
inlineoverridevirtual

Check if camera has the requested feature (saturation, brightness ... )

Parameters
featurethe identifier of the feature to check
hasFeatureflag value: true if the feature is present, false otherwise
Returns
returns true if success, false otherwise (e.g. the interface is not implemented)

Implements yarp::dev::IFrameGrabberControls.

Definition at line 34 of file CliMock.h.

◆ hasManual()

bool IFrameGrabberControlsMock::hasManual ( int  feature,
bool *  hasManual 
)
inlineoverridevirtual

Check if the requested feature has the 'manual' mode.

Parameters
featurethe identifier of the feature to check
hasAutoflag true if the feature is has 'manual' mode, false otherwise
Returns
returns true if success, false otherwise (e.g. the interface is not implemented)

Implements yarp::dev::IFrameGrabberControls.

Definition at line 45 of file CliMock.h.

◆ hasOnePush()

bool IFrameGrabberControlsMock::hasOnePush ( int  feature,
bool *  hasOnePush 
)
inlineoverridevirtual

Check if the requested feature has the 'onePush' mode.

Parameters
featurethe identifier of the feature to check
hasAutoflag true if the feature is has 'onePush' mode, false otherwise
Returns
returns true if success, false otherwise (e.g. the interface is not implemented)

Implements yarp::dev::IFrameGrabberControls.

Definition at line 46 of file CliMock.h.

◆ hasOnOff()

bool IFrameGrabberControlsMock::hasOnOff ( int  feature,
bool *  HasOnOff 
)
inlineoverridevirtual

Check if the camera has the ability to turn on/off the requested feature.

Parameters
featurethe identifier of the feature to change
hasOnOffflag true if this feature can be turned on/off, false otherwise.
Returns
returns true if success, false otherwise (e.g. the interface is not implemented)

Implements yarp::dev::IFrameGrabberControls.

Definition at line 41 of file CliMock.h.

◆ MOCK_METHOD() [1/2]

IFrameGrabberControlsMock::MOCK_METHOD ( bool  ,
getFeature  ,
(int, double *)  ,
(override)   
)

◆ MOCK_METHOD() [2/2]

IFrameGrabberControlsMock::MOCK_METHOD ( bool  ,
setFeature  ,
(int, double)  ,
(override)   
)

◆ setActive()

bool IFrameGrabberControlsMock::setActive ( int  feature,
bool  onoff 
)
inlineoverridevirtual

Set the requested feature on or off.

Parameters
featurethe identifier of the feature to change
onofftrue to activate, off to deactivate the feature
Returns
returns true on success, false on failure.

Implements yarp::dev::IFrameGrabberControls.

Definition at line 42 of file CliMock.h.

◆ setFeature()

bool IFrameGrabberControlsMock::setFeature ( int  feature,
double  value1,
double  value2 
)
inlineoverridevirtual

Set the requested feature to a value using 2 params (like white balance)

Parameters
featurethe identifier of the feature to change
value1first param, from 0 to 1 expressed as a percentage
value2second param, from 0 to 1 expressed as a percentage
Returns
returns true if success, false otherwise (e.g. the interface is not implemented)

Implements yarp::dev::IFrameGrabberControls.

Definition at line 35 of file CliMock.h.

◆ setMode()

bool IFrameGrabberControlsMock::setMode ( int  feature,
FeatureMode  mode 
)
inlineoverridevirtual

Set the requested mode for the feature.

Parameters
featurethe identifier of the feature to change
auto_onofftrue to activate 'auto' mode, false to activate 'manual' mode
Returns
returns true on success, false on failure.

Implements yarp::dev::IFrameGrabberControls.

Definition at line 47 of file CliMock.h.

◆ setOnePush()

bool IFrameGrabberControlsMock::setOnePush ( int  feature)
inlineoverridevirtual

Set the requested feature to a value (saturation, brightness ... )

Parameters
featurethe identifier of the feature to change
valuenew value of the feature, from 0 to 1 as a percentage of param range
Returns
returns true on success, false on failure.

Implements yarp::dev::IFrameGrabberControls.

Definition at line 49 of file CliMock.h.


The documentation for this class was generated from the following file: