Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
sf::RsaInterface Class Referenceabstract

Base class for the repetitive signal acquisition interface. More...

#include <RsaInterface.h>

Inheritance diagram for sf::RsaInterface:
Collaboration diagram for sf::RsaInterface:

Classes

struct  Parameters
 Parameters structure passed to an RSA implementation class. More...
 

Public Member Functions

 RsaInterface (const Parameters &)
 Constructor for passing general structure for derived classes.
 
virtual ~RsaInterface ()
 Virtual destructor for derived classes.
 
bool initialize ()
 Initializes the implementation for operation. Calls doInitialize.
 
bool uninitialize ()
 Un-initializes the implementation. Calls doInitialize.
 
EAcquisitionType getType () const
 
bool storeSettings (bool read)
 Writes the non exported parameters to profile.
 
int getError () const
 Gets the error value.
 
unsigned getChannelCount ()
 Gets the amount of channels for this implementation.
 
unsigned getGateCount (unsigned channel)
 Gets the amount of gates for this channels' implementation.
 
std::string getGateName (unsigned int gate, unsigned int channel=0)
 Gets the name of the passed gate and channel.
 
bool setPopManual (int channel, EPopManual pm)
 Sets the pop manual state for a channel.
 
EPopManual getPopManual (int channel) const
 Gets the pop-manual state on a channel.
 
bool getParamInfo (IdType id, ParamInfo &info) const
 
bool getParam (IdType id, Value &value) const
 Gets the value of the specified parameter id. When the ID does not exist it returns false.
 
bool setParam (IdType id, const Value &value, bool skip_event)
 Sets the value of the specified parameter id. When the ID does not exist it returns false.
 
bool paramSetGet (IdType id, Value &value, bool skip_event)
 Sets and immediately gets the same value again clipped or not.
 
virtual bool handleParam (IdType id, ParamInfo *info, const Value *setval, Value *getval)=0
 Pure virtual method to be overridden in a derived class. This method handles the interface parameters. When info in non-null the parameter info must be filled in. When the set or get value is non-null the value is set and/or retrieved.
 
bool setParam (EDefaultParam param, unsigned gate, unsigned ch, const Value &value, bool skip_event)
 Same as setParam() but the ID is formed by getParamId()
 
bool getParam (EDefaultParam param, unsigned gate, unsigned ch, Value &value) const
 Same as getParam() but the ID is formed by getParamId()
 
virtual bool setRunMode (bool on, bool clear)=0
 Sets the implementation in hold or Run mode.
 
virtual bool getRunMode () const =0
 Gets the current run mode of a derived class.
 
virtual IdType getParamId (EDefaultParam param, unsigned gate=UINT_MAX, unsigned channel=UINT_MAX) const =0
 Gets the ID of the parameter for the specified gate.
 
virtual bool enumParamIds (IdList &ids)=0
 Gets all interface parameters ids.
 
void setParamHook (NotifyProc proc, void *data)
 Sets a procedure hook for the interface implementation to be called when the value changes as a result of the implementation itself.
 
void setResultHook (NotifyProc proc, void *data)
 Sets a procedure hook for the interface implementation to be called when there ias data result has data.
 
virtual IdType getResultId (EDefaultResult result, unsigned gate=UINT_MAX, unsigned channel=UINT_MAX) const =0
 Returns the ID of the result for the specified gate.
 
virtual bool enumResultIds (IdList &ids)=0
 Gets interface results ids.
 
bool getResultInfo (IdType id, ResultInfo &info)
 Retrieve information about the passed id.
 
virtual bool handleResult (IdType id, ResultInfo *info, BufferInfo *bufInfo)=0
 Handles results.
 
bool getResultBuffer (IdType id, BufferInfo &bufInfo)
 Gets the result buffer associated with the result id passed in the result hook at the time of the call.
 
bool isInitialized () const
 For testing initialization by the implementation.
 
std::string getProfilePath () const
 Returns the path of the static configuration of the driver.
 
virtual void addPropertyPages (PropertySheetDialog *sheet)
 Adds controller specific property pages to the passed sheet.
 

Protected Member Functions

virtual bool doInitialize (bool init)
 Must be overridden by a derived class. Should check the hardware configuration.
 
void callParamHook (IdType id)
 Calls the hooked function when it exists.
 
void callResultHook (IdType id)
 Calls the hooked function when it exists.
 
bool setType (EAcquisitionType at)
 Sets the implementation type of the implementation used by the server side. Only allowed before and during initialization. By default, the type is ultrasonic.
 

Additional Inherited Members

- Public Types inherited from sf::RsaTypes
enum  EParamFlag {
  pfReadonly = 1 << 0 , pfEffectsParameter = 1 << 1 , pfEffectsResult = 1 << 2 , pfEffectsData = 1 << 3 ,
  pfChannelSingle = 1 << 4 , pfGate = 1 << 5 , pfMethod = 1 << 6 , pfExport = 1 << 7 ,
  pfSystem = 1 << 8 , pfWriteable = 1 << 9 , pfAlias = 1 << 10 , pfArchive = 1 << 11 ,
  pfWriteAtOff = 1 << 12
}
 Parameter flags for defining parameter behaviour. More...
 
enum  EResultFlag {
  rfGate = 1 << 0 , rfIndex = 1 << 1 , rfAsync = 1 << 2 , rfAsyncIndex = 1 << 3 ,
  rfHugeData = 1 << 4 , rfStored = 1 << 5
}
 Result flags for defining result behaviour. More...
 
enum  EAcquisitionType { atUltrasonic , atEddyCurrent }
 
enum  EDefaultParam : uint64_t {
  apNone = 0x0000 , apChannels = 0x0002 , apError = 0x0003 , apErrorMessage = 0x0004 ,
  apAmplitudeUnit = 0x0005 , apUserFirst = 0x000F , apChannel_Mask = 0x4000 , apChannel_RepRate = 0x4001 ,
  apChannel_SyncMode = 0x4002 , apChannel_Gates = 0x4003 , apChannel_Inputs = 0x4004 , apChannel_TimeUnits = 0x4005 ,
  apChannel_CopyDelay = 0x4006 , apChannel_CopyRange = 0x4007 , apChannel_SampleRate = 0x4008 , apChannel_CopyEnable = 0x4009 ,
  apChannel_PopManual = 0x400A , apChannel_BiDirMode = 0x400B , apChannel_UserFirst = 0x401F , apGate_Mask = 0x8000 ,
  apGate_Name = 0x8001 , apGate_Delay = 0x8002 , apGate_Range = 0x8003 , apGate_SlaveTo = 0x8004 ,
  apGate_Enable = 0x8005 , apGate_Method = 0x8006 , apGate_Threshold = 0x8007 , apGate_Amplitude = 0x8008 ,
  apGate_TimeOfFlight = 0x8009 , apGate_UserFirst = 0x801F
}
 
enum  EDefaultResult : uint64_t {
  arNone = 0x0000 , arUserFirst = 0x0001 , arChannel_Mask = 0x4000 , arChannel_PopIndex = 0x4001 ,
  arChannel_CopyData = 0x4002 , arChannel_CopyIndex = 0x4003 , arChannel_UserFirst = 0x401F , arGate_Amplitude = 0x8001 ,
  arGate_TimeOfFlight = 0x8002 , arGate_Copy = 0x8003 , arGate_Mask = 0x8000 , arGate_UserFirst = 0x801F
}
 
enum  EPopManual { pmDisabled = 0 , pmReady , pmTrigger }
 Enumerate for the pop manual function. More...
 
typedef unsigned long long IdType
 Type for gathering parameter ID's.
 
typedef TVector< IdTypeIdList
 Type for gathering parameter ID's.
 
typedef void(* NotifyProc) (void *data, IdType id)
 Function type for the function type which is called when a parameter changes as a result of changes in the interface itself.
 
typedef TVector< ParamStateParamStates
 Vector to specify states.
 

Detailed Description

Base class for the repetitive signal acquisition interface.

Constructor & Destructor Documentation

◆ RsaInterface()

sf::RsaInterface::RsaInterface ( const Parameters )
explicit

Constructor for passing general structure for derived classes.

◆ ~RsaInterface()

virtual sf::RsaInterface::~RsaInterface ( )
virtual

Virtual destructor for derived classes.

Member Function Documentation

◆ addPropertyPages()

virtual void sf::RsaInterface::addPropertyPages ( PropertySheetDialog sheet)
virtual

Adds controller specific property pages to the passed sheet.

Parameters
sheet

◆ callParamHook()

void sf::RsaInterface::callParamHook ( IdType  id)
protected

Calls the hooked function when it exists.

Parameters
idParameter identifier.

◆ callResultHook()

void sf::RsaInterface::callResultHook ( IdType  id)
protected

Calls the hooked function when it exists.

Parameters
idResult identifier.

◆ doInitialize()

virtual bool sf::RsaInterface::doInitialize ( bool  init)
inlineprotectedvirtual

Must be overridden by a derived class. Should check the hardware configuration.

Parameters
initTrue when initializing.
Returns
True on success.

◆ enumParamIds()

virtual bool sf::RsaInterface::enumParamIds ( IdList ids)
pure virtual

Gets all interface parameters ids.

Parameters
idsThe return value.
Returns
True on success.

Implemented in sf::AcquisitionEmulator.

◆ enumResultIds()

virtual bool sf::RsaInterface::enumResultIds ( IdList ids)
pure virtual

Gets interface results ids.

Parameters
idsList of identifiers
Returns
True on success.

Implemented in sf::AcquisitionEmulator.

◆ getChannelCount()

unsigned sf::RsaInterface::getChannelCount ( )

Gets the amount of channels for this implementation.

◆ getError()

int sf::RsaInterface::getError ( ) const

Gets the error value.

◆ getGateCount()

unsigned sf::RsaInterface::getGateCount ( unsigned  channel)

Gets the amount of gates for this channels' implementation.

Parameters
channelChannel number.
Returns
Channel count

◆ getGateName()

std::string sf::RsaInterface::getGateName ( unsigned int  gate,
unsigned int  channel = 0 
)

Gets the name of the passed gate and channel.

Parameters
gateGate number
channelChannel number.
Returns
Name of the gate.

◆ getParam() [1/2]

bool sf::RsaInterface::getParam ( EDefaultParam  param,
unsigned  gate,
unsigned  ch,
Value value 
) const

Same as getParam() but the ID is formed by getParamId()

◆ getParam() [2/2]

bool sf::RsaInterface::getParam ( IdType  id,
Value value 
) const

Gets the value of the specified parameter id. When the ID does not exist it returns false.

Parameters
idParameter identifier.
valueReturned value.
Returns
True on success.

◆ getParamId()

virtual IdType sf::RsaInterface::getParamId ( EDefaultParam  param,
unsigned  gate = UINT_MAX,
unsigned  channel = UINT_MAX 
) const
pure virtual

Gets the ID of the parameter for the specified gate.

Parameters
paramType of default parameter.
gateGate number and when UINT_MAX it is ignored.
channelChannel number and when UINT_MAX it is ignored.
Returns
True on success.

Implemented in sf::AcquisitionEmulator.

◆ getParamInfo()

bool sf::RsaInterface::getParamInfo ( IdType  id,
ParamInfo info 
) const

Retrieve information about the passed param id.

Parameters
idid Parameter identifier.
infoReturn value.
Returns
True on success.

◆ getPopManual()

EPopManual sf::RsaInterface::getPopManual ( int  channel) const

Gets the pop-manual state on a channel.

Parameters
channelChannel number.
Returns
Mode of pop manual.

◆ getProfilePath()

std::string sf::RsaInterface::getProfilePath ( ) const

Returns the path of the static configuration of the driver.

Returns
True on success.

◆ getResultBuffer()

bool sf::RsaInterface::getResultBuffer ( IdType  id,
BufferInfo bufInfo 
)

Gets the result buffer associated with the result id passed in the result hook at the time of the call.

Returns
True on success.

◆ getResultId()

virtual IdType sf::RsaInterface::getResultId ( EDefaultResult  result,
unsigned  gate = UINT_MAX,
unsigned  channel = UINT_MAX 
) const
pure virtual

Returns the ID of the result for the specified gate.

Parameters
resultDefault result type.
gateGate number and when UINT_MAX tels the argument is ignored.
channelChannel number and when UINT_MAX tels the argument is ignored.
Returns
True on success.

Implemented in sf::AcquisitionEmulator.

◆ getResultInfo()

bool sf::RsaInterface::getResultInfo ( IdType  id,
ResultInfo info 
)

Retrieve information about the passed id.

◆ getRunMode()

virtual bool sf::RsaInterface::getRunMode ( ) const
pure virtual

Gets the current run mode of a derived class.

Implemented in sf::AcquisitionEmulator.

◆ getType()

EAcquisitionType sf::RsaInterface::getType ( ) const

Gets the type of acquisition.

Returns
By default, the type returned ultrasonic.

◆ handleParam()

virtual bool sf::RsaInterface::handleParam ( IdType  id,
ParamInfo info,
const Value setval,
Value getval 
)
pure virtual

Pure virtual method to be overridden in a derived class. This method handles the interface parameters. When info in non-null the parameter info must be filled in. When the set or get value is non-null the value is set and/or retrieved.

Parameters
id
info
setval
getval
Returns

Implemented in sf::AcquisitionEmulator.

◆ handleResult()

virtual bool sf::RsaInterface::handleResult ( IdType  id,
ResultInfo info,
BufferInfo bufInfo 
)
pure virtual

Handles results.

Implemented in sf::AcquisitionEmulator.

◆ initialize()

bool sf::RsaInterface::initialize ( )

Initializes the implementation for operation. Calls doInitialize.

Returns
True on success.

◆ isInitialized()

bool sf::RsaInterface::isInitialized ( ) const
inline

For testing initialization by the implementation.

Returns
True on success.

◆ paramSetGet()

bool sf::RsaInterface::paramSetGet ( IdType  id,
Value value,
bool  skip_event 
)

Sets and immediately gets the same value again clipped or not.

Parameters
idParameter identifier.
valueSet, get value.
skip_event
Returns
True on success.

◆ setParam() [1/2]

bool sf::RsaInterface::setParam ( EDefaultParam  param,
unsigned  gate,
unsigned  ch,
const Value value,
bool  skip_event 
)

Same as setParam() but the ID is formed by getParamId()

◆ setParam() [2/2]

bool sf::RsaInterface::setParam ( IdType  id,
const Value value,
bool  skip_event 
)

Sets the value of the specified parameter id. When the ID does not exist it returns false.

Parameters
idParameter identifier.
valueSet value.
skip_event
Returns
True on success.

◆ setParamHook()

void sf::RsaInterface::setParamHook ( NotifyProc  proc,
void *  data 
)

Sets a procedure hook for the interface implementation to be called when the value changes as a result of the implementation itself.

◆ setPopManual()

bool sf::RsaInterface::setPopManual ( int  channel,
EPopManual  pm 
)

Sets the pop manual state for a channel.

Parameters
channelChannel number.
pmManual pop mode.
Returns
True on success.

◆ setResultHook()

void sf::RsaInterface::setResultHook ( NotifyProc  proc,
void *  data 
)

Sets a procedure hook for the interface implementation to be called when there ias data result has data.

◆ setRunMode()

virtual bool sf::RsaInterface::setRunMode ( bool  on,
bool  clear 
)
pure virtual

Sets the implementation in hold or Run mode.

Parameters
onWhen false the implementation goes in a non cpu time-consuming mode.
clearWhen true all pending results are cleared and the index counter is reset.
Returns
True on success.

Implemented in sf::AcquisitionEmulator.

◆ setType()

bool sf::RsaInterface::setType ( EAcquisitionType  at)
protected

Sets the implementation type of the implementation used by the server side. Only allowed before and during initialization. By default, the type is ultrasonic.

Parameters
atThe acquisition type.
Returns
True on success.

◆ storeSettings()

bool sf::RsaInterface::storeSettings ( bool  read)

Writes the non exported parameters to profile.

Parameters
readWhen true settings are read and with false written.
Returns
True on success.

◆ uninitialize()

bool sf::RsaInterface::uninitialize ( )

Un-initializes the implementation. Calls doInitialize.

Returns
True on success.

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