|
ifw-ccf
1.0.0
|
Class to be used as parent for CCF Communication Adapters. More...
#include <comAdptBase.hpp>
Public Member Functions | |
| ComAdptBase () | |
| virtual | ~ComAdptBase () |
| ccf::common::ConfigBase & | Cfg () |
| Return reference to general configuration object (singleton). More... | |
| const std::string & | GetCameraAddress () const |
| Return the address of the camera from the configuration. More... | |
| const std::string & | GetId () const |
| Get the ID of the associated camera. More... | |
| void | SetHostAdddress (const std::string &host_address) |
| Set the address of the host (network interface) used for communicating with the camera. More... | |
| const std::string & | GetHostAddress () |
| Return the address of the host (network interface) used for communicating with the camera. More... | |
| void | SetIsSimAdapter (const bool is_sim) |
| Set the Simulation Adapter Flag. More... | |
| bool | GetIsSimAdapter () const |
| Return the Simulation Adapter Flag. More... | |
| void | SetProtocol (const std::string &protocol) |
| Set the communication protocol used. More... | |
| const std::string & | GetProtocol () const |
| Return the communication protocol used. More... | |
| template<class TYPE > | |
| TYPE | GetCameraProperty (const std::string &property) |
| bool | HasCameraProperty (const std::string &property, std::string &value) |
| double | GetTheoreticFrameRate () |
| Render the theoritic, possible achievable frame rate (frame/s). More... | |
| void | LoadCameraNameMapping (const std::string &name_mapping_file) |
| void | Initialise (const bool re_init=false) |
| void | SetCameraAddress (const std::string &address) |
| Set the internal address, e.g. URI, used for communicating with the camera. More... | |
| void | CheckConnection (bool &connected) |
| Check if the connection to the camera is OK. More... | |
| void | CheckStatus (ccf::common::HwStatus &status, std::string &message) |
| Check the status of the camera (health status). More... | |
| bool | IsConnected () const |
| Returns true if the connection to the camera is established and valid. More... | |
| void | Connect () |
| void | Disconnect () |
| Disconnect from the camera. More... | |
| void | WriteAdapterProps () |
| virtual void | WriteAdapterPropsUser () |
| void | SetIsConnected (const bool connected) |
| bool | GetAllowLostFrames () const |
| Return flag (cfg par) indicating if lost frames shall be ignored silently. More... | |
| uint64_t | IncLostFramesCount () |
| Increment the counter of lost frames. The new value is returned. More... | |
| uint64_t | GetLostFramesCount () const |
| Return the number of lost frames currently registered. More... | |
| void | ResetLostFramesCount () |
| Reset the lost frames counter. More... | |
| void | Read (const std::string &name, ctd::param::Parameter &par) |
| void | Read (const std::vector< std::string > &names, std::vector< ctd::param::Parameter > &pars) |
| std::string | Read (const std::string &name) |
| template<class TYPE > | |
| TYPE | Read (const std::string &name) |
| Template method to read a parameter, taking care of the conversion to the desired user representation. More... | |
| void | Write (const ctd::param::Parameter &par) |
| void | Write (const std::vector< ctd::param::Parameter > &pars) |
| template<class TYPE > | |
| void | Write (const std::string &name, const TYPE &value) |
| Template method to write a parameter, taking care of converting the user data into the internal type. More... | |
| void | Receive (ccf::common::DataFrame &frame, bool &frame_received, const double timeout, bool &timed_out) |
| void | Scan (std::vector< ctd::param::Parameter > &pars) |
| Scan the address of the associated camera and store the parameters in the vector. More... | |
| void | Start () |
| Start the image acquisition in the camera. More... | |
| void | Stop () |
| Stop the image acquisition in the camera. More... | |
| void | HandleSetup () |
| void | HandleParPreWrite (ctd::param::Parameter &par) |
| void | HandleParPostWrite (ctd::param::Parameter &par) |
| Invoked after writing to the camera in case additional processing and downloading of parameters is needed. More... | |
| void | HandleParPostRead (ctd::param::Parameter &par) |
| Invoked before reading a parameter from the camera, in case speciel handling is needed. More... | |
| void | MapParForDevice (ctd::param::Parameter &par) const |
| void | MapParFromDevice (ctd::param::Parameter &par) const |
| bool | HasNameMapping (const std::string &name) const |
| Return true if a mapping is defined in the Camera Name Mapping for the given name. More... | |
| virtual void | InitialiseUser () |
| virtual void | SetCameraAddressUser (const std::string &address) |
| virtual void | CheckConnectionUser (bool &connected) |
| virtual void | CheckStatusUser (ccf::common::HwStatus &status, std::string &message) |
| virtual bool | HasCameraPropertyUser (const std::string &property, std::string &value) |
| virtual double | GetTheoreticFrameRateUser () |
| virtual void | ConnectUser () |
| virtual void | DisconnectUser () |
| virtual bool | IsConnectedUser () const |
| virtual void | ReadUser (const std::string &name, ctd::param::Parameter &par) |
| virtual void | ReadUser (const std::vector< std::string > &names, std::vector< ctd::param::Parameter > &pars) |
| virtual void | ReceiveUser (ccf::common::DataFrame &frame, bool &frame_received, const double timeout, bool &timed_out) |
| virtual void | ScanUser (std::vector< ctd::param::Parameter > &pars) |
| virtual void | StartUser () |
| virtual void | StopUser () |
| virtual void | WriteUser (const ctd::param::Parameter &par) |
| virtual void | WriteUser (const std::vector< ctd::param::Parameter > &pars) |
| virtual void | HandleSetupUser () |
| virtual void | HandleParPreWriteUser (ctd::param::Parameter &par) |
| virtual void | HandleParPostWriteUser (ctd::param::Parameter &par) |
| virtual void | HandleParPostReadUser (ctd::param::Parameter &par) |
Public Member Functions inherited from ccf::common::Base | |
| Base () | |
| ~Base () | |
| const std::string & | GetClassName () const |
| Return the allocated name of the class. More... | |
Protected Attributes | |
| bool | m_is_connected |
Additional Inherited Members | |
Static Public Member Functions inherited from ccf::common::Base | |
| static ccf::mptk::Manager & | Mptk () |
| Return reference to internal MPTK instance (singleton). More... | |
| static void | SetLogLevel (const ccf::common::LogLevel log_level) |
| Set the log level. More... | |
| static ccf::common::LogLevel | GetLogLevel () |
| Return the current CCF log level. More... | |
Protected Member Functions inherited from ccf::common::Base | |
| void | SetClassName (const std::string &class_name) |
| Set the name of the class in question. More... | |
Class to be used as parent for CCF Communication Adapters.
The adapter shall be used as parent class when implementing specific adapters. Methods to be provided by the specific implemented, have a name of the form "<action>User". Note, it may not be necessary to implement all 'user'/virtual methods.
| ccf::common::ComAdptBase::ComAdptBase | ( | ) |
|
virtual |
| ccf::common::ConfigBase & ccf::common::ComAdptBase::Cfg | ( | ) |
Return reference to general configuration object (singleton).
| void ccf::common::ComAdptBase::CheckConnection | ( | bool & | connected | ) |
Check if the connection to the camera is OK.
|
virtual |
Specific implementation of the connection check algorithm. See also "CheckConnection()".
Reimplemented in ccf::protocols::aravis::ComAdptAravis, ccf::control::ComAdptSim, and ccf::common::test::ComAdptTest.
| void ccf::common::ComAdptBase::CheckStatus | ( | ccf::common::HwStatus & | status, |
| std::string & | message | ||
| ) |
Check the status of the camera (health status).
|
virtual |
Specific implementation of the status check algorithm. See also "CheckStatus()".
Reimplemented in ccf::protocols::aravis::ComAdptAravis, ccf::control::ComAdptSim, and ccf::common::test::ComAdptTest.
| void ccf::common::ComAdptBase::Connect | ( | ) |
|
virtual |
Specific implementation of the connection algorithm to connect to the camera. See also "Connect()".
Reimplemented in ccf::protocols::aravis::ComAdptAravis, ccf::control::ComAdptSim, and ccf::common::test::ComAdptTest.
| void ccf::common::ComAdptBase::Disconnect | ( | ) |
Disconnect from the camera.
|
virtual |
Specific implementation of the algorithm to disconnect from the camera. See also "Disconnect()".
Reimplemented in ccf::protocols::aravis::ComAdptAravis, ccf::control::ComAdptSim, and ccf::common::test::ComAdptTest.
| bool ccf::common::ComAdptBase::GetAllowLostFrames | ( | ) | const |
Return flag (cfg par) indicating if lost frames shall be ignored silently.
| const std::string & ccf::common::ComAdptBase::GetCameraAddress | ( | ) | const |
Return the address of the camera from the configuration.
|
inline |
Retrieve a property of the camera, e.g. the width of the detector chip (CFG_CAM_CHIP_WIDTH). If not available from the camera, it is taken from the configuration.
| const std::string & ccf::common::ComAdptBase::GetHostAddress | ( | ) |
Return the address of the host (network interface) used for communicating with the camera.
| const std::string & ccf::common::ComAdptBase::GetId | ( | ) | const |
Get the ID of the associated camera.
| bool ccf::common::ComAdptBase::GetIsSimAdapter | ( | ) | const |
Return the Simulation Adapter Flag.
| uint64_t ccf::common::ComAdptBase::GetLostFramesCount | ( | ) | const |
Return the number of lost frames currently registered.
| const std::string & ccf::common::ComAdptBase::GetProtocol | ( | ) | const |
Return the communication protocol used.
| double ccf::common::ComAdptBase::GetTheoreticFrameRate | ( | ) |
Render the theoritic, possible achievable frame rate (frame/s).
|
virtual |
Specific implementation of the algorithm to estimate the theoretic frame rate. Need normally not to be provided for specific Communication Adapters. See also "GetTheoreticFrameRate()".
Reimplemented in ccf::protocols::aravis::ComAdptAravis.
| void ccf::common::ComAdptBase::HandleParPostRead | ( | ctd::param::Parameter & | par | ) |
Invoked before reading a parameter from the camera, in case speciel handling is needed.
|
virtual |
Specific implementation of the algorithm to process a parameter after reading it from the camera. See also "HandleParPostRead()".
Reimplemented in ccf::common::test::ComAdptTest.
| void ccf::common::ComAdptBase::HandleParPostWrite | ( | ctd::param::Parameter & | par | ) |
Invoked after writing to the camera in case additional processing and downloading of parameters is needed.
|
virtual |
Specific implementation of the parameter processing after this is written to the camera. See also "HandleParPostWrite()".
Reimplemented in ccf::common::test::ComAdptTest.
| void ccf::common::ComAdptBase::HandleParPreWrite | ( | ctd::param::Parameter & | par | ) |
Invoked before writing a parameter to the camera if specific handling is required, e.g. converting the value to the camera representation.
|
virtual |
Specific implementation of the parameter processing before this is written to the camera. See also "HandleParPreWrite()".
Reimplemented in ccf::common::test::ComAdptTest.
| void ccf::common::ComAdptBase::HandleSetup | ( | ) |
Method invoked to handle set up parameters to be written to the camera. Is invoked when a Setup Request is received.
|
virtual |
Specific implementation of the handling of new setup parameters. See also "HandleSetup()".
Reimplemented in ccf::control::ComAdptSim.
| bool ccf::common::ComAdptBase::HasCameraProperty | ( | const std::string & | property, |
| std::string & | value | ||
| ) |
Check if a given camera property is defined, e.g. the width or height of the chip. Returns true if property exists and sets the value (as a string) in the "value" parameter.
Ignore and try to get the value from the cfg.
|
virtual |
Specific implementation of the algorithm to check for a specific camera property. Need normally not to be provided for specific Communication Adapters. See also "HasCameraProperty()".
| bool ccf::common::ComAdptBase::HasNameMapping | ( | const std::string & | name | ) | const |
Return true if a mapping is defined in the Camera Name Mapping for the given name.
| uint64_t ccf::common::ComAdptBase::IncLostFramesCount | ( | ) |
Increment the counter of lost frames. The new value is returned.
| void ccf::common::ComAdptBase::Initialise | ( | const bool | re_init = false | ) |
Method encapsulating the user specific implementations. The method is invoked when the object is instantiated.
|
virtual |
Specific implementation of the adapter/camera initialisation. See also "Initialise()".
Reimplemented in ccf::protocols::aravis::ComAdptAravis, ccf::control::ComAdptSim, and ccf::common::test::ComAdptTest.
| bool ccf::common::ComAdptBase::IsConnected | ( | ) | const |
Returns true if the connection to the camera is established and valid.
|
virtual |
Specific implementation of the algorithm to determine if a connection to the camera is established. See also "IsConnected()".
Reimplemented in ccf::protocols::aravis::ComAdptAravis, and ccf::common::test::ComAdptTest.
| void ccf::common::ComAdptBase::LoadCameraNameMapping | ( | const std::string & | name_mapping_file | ) |
Load the specified Camera Name Mapping. The Camera Name Mapping maps the internal names used in CCF into the actual names defined by the camera.
| void ccf::common::ComAdptBase::MapParForDevice | ( | ctd::param::Parameter & | par | ) | const |
Map the parameter to the camera name, applying the Camera Name Mapping. If the parameter is not defined, the mapped parameter will be the same as the internal parameter.
| void ccf::common::ComAdptBase::MapParFromDevice | ( | ctd::param::Parameter & | par | ) | const |
Map a parameter name, received from the camera, applying the Camera Name Mapping. If the parameter is not defined, the mapped parameter will be the same as the internal parameter.
| std::string ccf::common::ComAdptBase::Read | ( | const std::string & | name | ) |
Read a parameter from the camera and return it. The name may be mapped from the camera to the internal level representation, if defined in the Camera Name Mapping.
|
inline |
Template method to read a parameter, taking care of the conversion to the desired user representation.
| void ccf::common::ComAdptBase::Read | ( | const std::string & | name, |
| ctd::param::Parameter & | par | ||
| ) |
Read a parameter from the camera. The name may be mapped from the camera to the internal level representation, if defined in the Camera Name Mapping.
| void ccf::common::ComAdptBase::Read | ( | const std::vector< std::string > & | names, |
| std::vector< ctd::param::Parameter > & | pars | ||
| ) |
Read a set of parametera from the camera. The names may be mapped from the camera to the internal level representation, if defined in the Camera Name Mapping.
|
virtual |
Specific implementation of the reading of single parameter from the camera. See also "Read(single)".
Reimplemented in ccf::protocols::aravis::ComAdptAravis, ccf::control::ComAdptSim, and ccf::common::test::ComAdptTest.
|
virtual |
Specific implementation of the algorithm to read multiple parameters from the camera. Need normally not to be provided for specific Communication Adapters. See also "Read(multiple)".
| void ccf::common::ComAdptBase::Receive | ( | ccf::common::DataFrame & | frame, |
| bool & | frame_received, | ||
| const double | timeout, | ||
| bool & | timed_out | ||
| ) |
Method to receive a frame from the camera. Only entire frames are handled. See also "ReceiveUser()".
| [out] | frame | Frame object, which will contain the frames, if one received. |
| [out] | frame_received | Indicates if a frame was received. |
| [in] | timeout | Timeout in seconds to apply, waiting for the next frame. |
| [out] | timed_out | Indicates if the request for a frame timed out. |
|
virtual |
Specific implementation of the frame reception. See also "Receive()".
Reimplemented in ccf::protocols::aravis::ComAdptAravis, ccf::control::ComAdptSim, and ccf::common::test::ComAdptTest.
| void ccf::common::ComAdptBase::ResetLostFramesCount | ( | ) |
Reset the lost frames counter.
| void ccf::common::ComAdptBase::Scan | ( | std::vector< ctd::param::Parameter > & | pars | ) |
Scan the address of the associated camera and store the parameters in the vector.
|
virtual |
Specific implementation of the scanning of the defined parameters in the camera namespace. See also "Scan()".
Reimplemented in ccf::protocols::aravis::ComAdptAravis, ccf::control::ComAdptSim, and ccf::common::test::ComAdptTest.
| void ccf::common::ComAdptBase::SetCameraAddress | ( | const std::string & | address | ) |
Set the internal address, e.g. URI, used for communicating with the camera.
|
virtual |
Specific implementation of the handling of the camera addresss/URI. See also "SetCameraAddress()".
Reimplemented in ccf::common::test::ComAdptTest.
| void ccf::common::ComAdptBase::SetHostAdddress | ( | const std::string & | host_address | ) |
Set the address of the host (network interface) used for communicating with the camera.
| void ccf::common::ComAdptBase::SetIsConnected | ( | const bool | connected | ) |
Method by which derived adapters can force the status to connected or not connected. To be used with care!
| void ccf::common::ComAdptBase::SetIsSimAdapter | ( | const bool | is_sim | ) |
Set the Simulation Adapter Flag.
| void ccf::common::ComAdptBase::SetProtocol | ( | const std::string & | protocol | ) |
Set the communication protocol used.
| void ccf::common::ComAdptBase::Start | ( | ) |
Start the image acquisition in the camera.
|
virtual |
Specific implementation of the algorithm to start the image acquisition in the camera. See also "Start()".
Reimplemented in ccf::protocols::aravis::ComAdptAravis, ccf::control::ComAdptSim, and ccf::common::test::ComAdptTest.
| void ccf::common::ComAdptBase::Stop | ( | ) |
Stop the image acquisition in the camera.
|
virtual |
Specific implementation of the algorithm to stop the image acquisition in the camera. See also "Stop()".
Reimplemented in ccf::protocols::aravis::ComAdptAravis, ccf::control::ComAdptSim, and ccf::common::test::ComAdptTest.
| void ccf::common::ComAdptBase::Write | ( | const ctd::param::Parameter & | par | ) |
Write a parameter to the camera. The name may be mapped from the internal to the camera representation, if defined in the Camera Name Mapping.
|
inline |
Template method to write a parameter, taking care of converting the user data into the internal type.
| void ccf::common::ComAdptBase::Write | ( | const std::vector< ctd::param::Parameter > & | pars | ) |
Write a set of parameters to the camera. The name may be mapped from the internal to the camera representation, if defined in the Camera Name Mapping.
| void ccf::common::ComAdptBase::WriteAdapterProps | ( | ) |
Write the Adapter Properties (cfg key: "cam.adapter.property#=<prop>=<val>") to the adapter (camera). Only the Adapter Properties defined in the Camera Name Mapping will be written to the camera.
|
virtual |
Write the adapter properties (cfg key: "cam.adapter.property#=<prop>=<val>") to the adapter (camera). Default implementation: Only properties defined in the Camera Name Mapping are written to the adapter/camera. Specific implementation.
|
virtual |
Specific implementation of the algorithm to write single parameters to the camera. See also "Write(single)".
Reimplemented in ccf::protocols::aravis::ComAdptAravis, ccf::control::ComAdptSim, and ccf::common::test::ComAdptTest.
|
virtual |
Specific implementation of the algorithm to write a set of parameters to the camera. Need normally not to be provided for specific Communication Adapters. See also "Write(multiple)".
|
protected |