Scanframe Modular Application 0.1.0
|
RSA implementation of a information server. More...
#include <RsaServer.h>
Classes | |
struct | ExtraInfo |
Structure placed in the Variable's Data field for fast access to information. More... | |
Public Member Functions | |
RsaServer (int compatible, id_type deviceNumber, const std::string &serverName={}) | |
Constructor. | |
~RsaServer () override | |
std::string | getServerName () const |
bool | createImplementation (const std::string &name) |
Creates an attached implementation by name. | |
std::string | getImplementationName () const |
Gets the name of the current implementation. | |
void | destroyImplementation () |
Destroys the created implementation. | |
RsaInterface * | getAcquisition () |
Gets a pointer to the current acquisition implementation. | |
bool | isLocked () const |
Returns true whe all parameters are locked. | |
void | setLocked (bool) |
Locks the variables by making them all read only. | |
Public Member Functions inherited from sf::InformationServer | |
InformationServer () | |
Default constructor. | |
virtual | ~InformationServer () |
void | setup (const std::string &name, const std::string &namePrefix, long vid, long deviceMask, long serverMask) |
When device mask is non-zero, variables are added automatically on creation to this info server. | |
void | flush () |
Clears the instance. Also called from setup. | |
EState | getState () const |
Gets the current state. | |
const char * | getStateName (int state) const |
Gets the name of the passed state. | |
void | setState (EState) |
Sets the current state. | |
bool | isServerId (id_type id) const |
Determines if the passed id belongs to this info server. | |
void | attachVariable (Variable *var, EClass cls) |
Adds a variable to the variables vector. | |
void | detachVariable (Variable *var) |
void | attachResult (ResultData *res) |
void | detachResult (ResultData *res) |
bool | isGeneratingResults () |
Protected Member Functions | |
bool | createImplementation (int index) |
Creates the implementation of index on the registered implementations. | |
void | createInterface () |
Create interface parameters at construction once. | |
void | destroyInterface () |
Remove all parameters and results. | |
Variable::PtrVector::size_type | variableListFind (id_type id) const |
Looks up a parameter which is represented by the interface id. | |
bool | createVariable (Variable *&var, RsaTypes::ParamInfo &info, const std::string &setup) |
Creates a variable with a extra info structure attached. | |
void | destroyVariable (Variable *var) |
Destroys a variable including the attached extra info structure. | |
std::string | createSetupString (const RsaTypes::ParamInfo &info, long vid) |
Creates a setup string from the passed parameter info structure. | |
void | evaluateInterfaceParams () |
Evaluate parameters after the configuration has changed. | |
std::string | getNameOffset (const RsaTypes::ParamInfo &info) |
Gets the name of the channel using the device name. | |
std::string | getDescription (const RsaTypes::ParamInfo &info) |
Gets the description prefix of the channel. | |
ResultData::PtrVector::size_type | resultListFind (id_type id) const |
Looks up a result data which is represented by the interface id. | |
bool | createResultData (ResultData *&res, RsaTypes::ResultInfo &info, const std::string &setup) |
Creates a variable with a extra info structure attached. | |
void | destroyResultData (ResultData *var) |
Destroys a variable including the attached extra info structure. | |
std::string | createSetupString (const RsaTypes::ResultInfo &info, long vid) |
Creates a setup string from the passed result info structure. | |
void | evaluateInterfaceResults () |
Evaluate results after the configuration has changed. | |
std::string | getNameOffset (const RsaTypes::ResultInfo &info) |
Returns the name of the channel using the device name. | |
std::string | getDescription (const RsaTypes::ResultInfo &info) |
Returns the description prefix of the channel. | |
ExtraInfo * | castExtraInfo (const Variable *var) |
Easy to use function to access the extra info from a variable. | |
ExtraInfo * | castExtraInfo (const ResultData *var) |
Easy to use function to access the extra info from a result data. | |
void | onStateChange (EState prevState, EState nextState) override |
Overloaded from TInfoServer. | |
void | paramNotify (id_type id) |
Hook function indirectly called from the implementation. | |
void | resultNotify (id_type id) |
Hook function indirectly called from the implementation. | |
void | checkReadOnly () |
Sets the variables to readonly based on the flags and lock status. | |
void | clearValidations () override |
Overridden from InformationServer. | |
void | serverVariableHandler (Variable::EEvent event, const Variable &caller, Variable &linker, bool sameInst) |
Event handler for variables. | |
void | serverResultDataHandler (ResultData::EEvent event, const ResultData &caller, ResultData &link, const Range &rng, bool same_inst) |
Event handler for results. | |
Static Protected Member Functions | |
static void | paramNotifyProc (void *data, id_type id) |
Parameter hook function called directly by the implementation. | |
static void | resultNotifyProc (void *data, id_type id) |
Result hook function called directly by the implementation. | |
Protected Attributes | |
RsaInterface * | _acquisition |
Holds the acquisition implementation. | |
Variable | _vImplementation |
Variable for selecting an implementation. | |
TVariableHandler< RsaServer > | _serverVariableHandler |
Callback hook for variable events. | |
Variable::PtrVector | _variableVector |
Holds all created variables for the selected implementation. | |
TResultDataHandler< RsaServer > | _serverResultDataHandler |
Callback hook for result events. | |
ResultData::PtrVector | _resultVector |
Holds all created results for this instance. | |
IdType | _deviceNumber |
Holds the device number passed at the constructor. | |
IdType | _implementationId |
Holds the VID of the implementation. | |
int | _compatible |
Holds the compatibility state passed at the constructor. | |
std::string | _serverName |
Holds the device name for creating the variable names. | |
bool | _lock |
Variable indicating lock status. | |
IdType | _handledParamId |
ID of interface parameter being processed by the param hook. | |
Additional Inherited Members | |
Public Types inherited from sf::InformationServer | |
enum | EState { issOff = 0 , issRun , issRecord , issPause , issStop , issMaxState } |
Enumerate for state of the info server. More... | |
enum | EClass { clA = 0 , clB , clC , clMaxClass } |
Variable/parameter class enumerator. More... | |
Public Types inherited from sf::InformationTypes | |
typedef unsigned long long | id_type |
Type used for the identifying integer (64-bits). | |
typedef int32_t | flags_type |
Type used for the flag integer. | |
typedef size_t | size_type |
Type used for size of vectors. | |
typedef uint64_t | data_type |
Type used for containing a single data element which is the largest integer. | |
typedef int64_t | sdata_type |
Type used for containing a single data element which is the largest signed integer. | |
typedef TVector< id_type > | IdVector |
Vector for lists of information ID's. | |
typedef TVector< InformationBase * > | Vector |
Vector for containing different information base derived classes. | |
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< IdType > | IdList |
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< ParamState > | ParamStates |
Vector to specify states. | |
Static Public Attributes inherited from sf::InformationTypes | |
static constexpr size_t | npos = std::numeric_limits<size_type>::max() |
Unsigned size value indicating not found or no index. | |
RSA implementation of a information server.
|
explicit |
Constructor.
compatible | Compatibility switch. 1=Strip-chart 0=Current 2=Nerason |
deviceNumber | The device number used for creating an implementation. (default is UT) |
serverName | Server name added to the settings and results. (Default is 'Acquisition') |
|
override |
Destructor.
|
protected |
Easy to use function to access the extra info from a result data.
Easy to use function to access the extra info from a variable.
|
protected |
Sets the variables to readonly based on the flags and lock status.
|
overrideprotectedvirtual |
Overridden from InformationServer.
Reimplemented from sf::InformationServer.
bool sf::RsaServer::createImplementation | ( | const std::string & | name | ) |
Creates an attached implementation by name.
|
protected |
Creates the implementation of index on the registered implementations.
|
protected |
Create interface parameters at construction once.
|
protected |
Creates a variable with a extra info structure attached.
|
protected |
Creates a setup string from the passed parameter info structure.
|
protected |
Creates a setup string from the passed result info structure.
|
protected |
Creates a variable with a extra info structure attached.
|
inline |
Destroys the created implementation.
|
protected |
Remove all parameters and results.
|
protected |
Destroys a variable including the attached extra info structure.
|
protected |
Destroys a variable including the attached extra info structure.
|
protected |
Evaluate parameters after the configuration has changed.
|
protected |
Evaluate results after the configuration has changed.
|
inline |
Gets a pointer to the current acquisition implementation.
|
protected |
Gets the description prefix of the channel.
|
protected |
Returns the description prefix of the channel.
std::string sf::RsaServer::getImplementationName | ( | ) | const |
Gets the name of the current implementation.
|
protected |
Gets the name of the channel using the device name.
|
protected |
Returns the name of the channel using the device name.
std::string sf::RsaServer::getServerName | ( | ) | const |
Gets the name given at the constructor.
|
inline |
Returns true whe all parameters are locked.
Overloaded from TInfoServer.
Implements sf::InformationServer.
|
protected |
Hook function indirectly called from the implementation.
|
staticprotected |
Parameter hook function called directly by the implementation.
|
protected |
Looks up a result data which is represented by the interface id.
|
protected |
Hook function indirectly called from the implementation.
|
staticprotected |
Result hook function called directly by the implementation.
|
protected |
Event handler for results.
|
protected |
Event handler for variables.
void sf::RsaServer::setLocked | ( | bool | ) |
Locks the variables by making them all read only.
|
protected |
Looks up a parameter which is represented by the interface id.
|
protected |
Holds the acquisition implementation.
|
protected |
Holds the compatibility state passed at the constructor.
|
protected |
Holds the device number passed at the constructor.
|
protected |
ID of interface parameter being processed by the param hook.
|
protected |
Holds the VID of the implementation.
|
protected |
Variable indicating lock status.
|
protected |
Holds all created results for this instance.
|
protected |
Holds the device name for creating the variable names.
|
protected |
Callback hook for result events.
|
protected |
Callback hook for variable events.
|
protected |
Holds all created variables for the selected implementation.