Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
sf::AcquisitionEmulator Class Reference

Implements a repetitive signal acquisition emulator. More...

#include <RsaEmulator.h>

Inheritance diagram for sf::AcquisitionEmulator:
Collaboration diagram for sf::AcquisitionEmulator:

Public Types

enum  EPolarity : int { plNegative = -1 , plFull = 0 , plPositive = 1 }
 
- 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.
 

Public Member Functions

 AcquisitionEmulator (const Parameters &)
 
 ~AcquisitionEmulator () override
 
bool setRunMode (bool runMode, bool clear) override
 Sets the implementation in hold or Run mode.
 
bool getRunMode () const override
 Gets the current run mode of a derived class.
 
IdType getParamId (EDefaultParam param, unsigned gate, unsigned channel) const override
 Gets the ID of the parameter for the specified gate.
 
bool handleParam (IdType id, ParamInfo *info, const Value *setval, Value *getval) override
 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.
 
IdType getResultId (EDefaultResult result, unsigned gate, unsigned channel) const override
 Returns the ID of the result for the specified gate.
 
bool handleResult (IdType id, ResultInfo *info, BufferInfo *bufInfo) override
 Handles results.
 
bool enumParamIds (IdList &ids) override
 Gets all interface parameters ids.
 
bool enumResultIds (IdList &ids) override
 Gets interface results ids.
 
- Public Member Functions inherited from sf::RsaInterface
 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.
 
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()
 
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.
 
bool getResultInfo (IdType id, ResultInfo &info)
 Retrieve information about the passed id.
 
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.
 

Additional Inherited Members

- Protected Member Functions inherited from sf::RsaInterface
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.
 

Detailed Description

Implements a repetitive signal acquisition emulator.

Member Enumeration Documentation

◆ EPolarity

Polarity enumeration.

Enumerator
plNegative 

Detect a negative peak.

plFull 

Detect positive and negative peak.

plPositive 

Detect a positive peak.

Constructor & Destructor Documentation

◆ AcquisitionEmulator()

sf::AcquisitionEmulator::AcquisitionEmulator ( const Parameters )
explicit

◆ ~AcquisitionEmulator()

sf::AcquisitionEmulator::~AcquisitionEmulator ( )
override

Member Function Documentation

◆ enumParamIds()

bool sf::AcquisitionEmulator::enumParamIds ( IdList ids)
overridevirtual

Gets all interface parameters ids.

Parameters
idsThe return value.
Returns
True on success.

Implements sf::RsaInterface.

◆ enumResultIds()

bool sf::AcquisitionEmulator::enumResultIds ( IdList ids)
overridevirtual

Gets interface results ids.

Parameters
idsList of identifiers
Returns
True on success.

Implements sf::RsaInterface.

◆ getParamId()

IdType sf::AcquisitionEmulator::getParamId ( EDefaultParam  param,
unsigned  gate,
unsigned  channel 
) const
overridevirtual

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.

Implements sf::RsaInterface.

◆ getResultId()

IdType sf::AcquisitionEmulator::getResultId ( EDefaultResult  result,
unsigned  gate,
unsigned  channel 
) const
overridevirtual

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.

Implements sf::RsaInterface.

◆ getRunMode()

bool sf::AcquisitionEmulator::getRunMode ( ) const
overridevirtual

Gets the current run mode of a derived class.

Implements sf::RsaInterface.

◆ handleParam()

bool sf::AcquisitionEmulator::handleParam ( IdType  id,
ParamInfo info,
const Value setval,
Value getval 
)
overridevirtual

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

Implements sf::RsaInterface.

◆ handleResult()

bool sf::AcquisitionEmulator::handleResult ( IdType  id,
ResultInfo info,
BufferInfo bufInfo 
)
overridevirtual

Handles results.

Implements sf::RsaInterface.

◆ setRunMode()

bool sf::AcquisitionEmulator::setRunMode ( bool  on,
bool  clear 
)
overridevirtual

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.

Implements sf::RsaInterface.

Member Data Documentation

◆ Gain

double sf::AcquisitionEmulator::Gain {0}

◆ Time

double sf::AcquisitionEmulator::Time {0}

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