Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
sf::GmiServer Class Referencefinal

#include <GmiServer.h>

Inheritance diagram for sf::GmiServer:
Collaboration diagram for sf::GmiServer:

Classes

struct  ExtraInfo
 Structure placed in the TVariable's Data field for fast access to information. More...
 

Public Member Functions

 GmiServer (id_type device_number, const std::string &server_name)
 Constructor.
 
 ~GmiServer ()
 Destructor.
 
std::string getServerName () const
 Gets the name given at the constructor.
 
std::string getImplementationName () const
 Gets the name of the current implementation.
 
bool createImplementation (const std::string &name={})
 Creates an attached implementation by name.
 
void destroyImplementation ()
 Destroys the created implementation.
 
void addPropertyPages (PropertySheetDialog *sheet)
 Add the property sheets for this server to the given dialog.
 
const VariablegetVariable (int pid)
 Gets the owner variable that corresponds the motion interfaces parameter id.
 
const Variable::PtrVectorgetVariables () const
 Gets all associated variables of the implementation.
 
gmi::ControllergetController ()
 Gets the created controller pointer.
 
bool isLocked () const
 Returns true when all parameters are locked.
 
void setLocked (bool flag)
 Locks the variables by making them all read only.
 

Protected Member Functions

unsigned getAxisCount ()
 Gets the amount of axes for this implementation.
 
std::string getAxisName (int axis)
 Gets the axis name of the given axis.
 
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 the interface by the given id.
 
bool createVariable (Variable *&var, const gmi::ParamInfo &info, const std::string &setup)
 Creates a variable with an extra info structure attached.
 
void destroyVariable (Variable *var)
 Destroys a variable including the attached extra info structure.
 
std::string createSetupString (const gmi::ParamInfo &info, gmi::IdType vid)
 Creates a setup string from the passed parameter info structure.
 
void evaluateInterfaceParams ()
 Evaluate parameters after the configuration has changed.
 
std::string GetNameOfs (const gmi::ParamInfo &info)
 Gets the name of the channel using the device name.
 
ResultData::PtrVector::size_type resultListFind (id_type id) const
 Looks up a result data which is represented the interface id.
 
ResultDataCreateResultData (const gmi::ResultInfo &info, const std::string &setup)
 Creates a variable with an extra info structure attached.
 
void destroyResultData (ResultData *var)
 Destroys a variable including the attached extra info structure.
 
std::string createSetupString (const gmi::ResultInfo &info, gmi::IdType vid)
 Creates a setup string from the passed result info structure.
 
void evaluateInterfaceResults ()
 Evaluate results after the configuration has changed.
 
std::string GetNameOfs (const gmi::ResultInfo &info)
 Returns the name of the channel using the device name.
 
ExtraInfocastExtraInfo (Variable *var) const
 Easy to use function to access the extra info from a variable. TODO: Use Variable::getData<type>() template function for casting.
 
ExtraInfocastExtraInfo (ResultData *var) const
 Easy to use function to access the extra info from a result data. TODO: Use ResultData::getData<type>() template function for casting.
 
void clearValidations ()
 Clears the committed ranges of the attached results if there are any.
 
void serverVariableHandler (Variable::EEvent event, const Variable &caller, Variable &linker, bool same_inst)
 Event handler for variables.
 
void serverResultDataHandler (ResultData::EEvent event, const ResultData &caller, ResultData &link, const Range &rng, bool same_inst)
 Event handler for results.
 
void paramNotify (id_type id)
 Hook function for parameter indirectly called from the implementation.
 
void resultNotify (id_type id)
 Hook function for parameter indirectly called from the implementation.
 
void checkReadOnly ()
 Sets the variables to readonly based on the flags and lock status.
 

Static Protected Member Functions

static void paramNotifyProc (void *data, gmi::IdType id)
 
static void resultNotifyProc (void *data, gmi::IdType id)
 

Protected Attributes

gmi::Controller_controller
 Holds the controller implementation.
 
Variable _vImplementation
 Variable for selecting an implementation.
 
TVariableHandler< GmiServer_serverVariableHandler
 Callback hook for variable events.
 
Variable::PtrVector _variableVector
 Holds all created variables for the selected implementation.
 
TResultDataHandler< GmiServer_serverResultDataHandler
 Callback hook for result events.
 
ResultData::PtrVector _resultVector
 Holds all created results for this instance.
 
int _deviceNumber
 Holds the device number for this server.
 
std::string _serverName
 Holds the device name for creating the variable names.
 
bool _lock
 Variable indicating lock status.
 
gmi::IdType _handledParamId
 The id of the interface parameter being processed by the param hook.
 
int _varHandlerEntryCount
 Holds the variable handler entry count.
 
const Variable_vMovePos
 Holds the pointer to a position motion status variable.
 
const Variable_vMoveVel
 Holds the pointer to a velocity motion status variable.
 
Variable _zero {0, false}
 Variable returned when not found.
 

Friends

class MotionVariablePropertyPage
 

Additional Inherited Members

- 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 ssize_t ssize_type
 Same as size_type but a signed version.
 
typedef uintptr_t data_type
 Type used for containing a single data element which is the largest integer.
 
typedef intptr_t sdata_type
 Type used for containing a single data element which is the largest signed integer.
 
typedef TVector< id_typeIdVector
 Vector for lists of information ID's.
 
typedef TVector< InformationBase * > Vector
 Vector for containing different information base derived classes.
 
- Static Public Member Functions inherited from sf::InformationTypes
template<typename T >
static constexpr std::enable_if_t<(sizeof(T)<=sizeof(data_type)), data_typetoDataType (T value)
 Casts any type to a data_type value.
 
template<typename T >
static constexpr std::enable_if_t<(sizeof(T)<=sizeof(data_type)||std::is_reference_v< T >), T > fromDataType (data_type value)
 Casts a data_type value to a given type. Reference types are also possible since they are the same size as a pointer underwater.
 
- 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.
 

Constructor & Destructor Documentation

◆ GmiServer()

sf::GmiServer::GmiServer ( id_type  device_number,
const std::string &  server_name 
)
explicit

Constructor.

Parameters
device_number
server_name

◆ ~GmiServer()

sf::GmiServer::~GmiServer ( )

Destructor.

Member Function Documentation

◆ addPropertyPages()

void sf::GmiServer::addPropertyPages ( PropertySheetDialog sheet)

Add the property sheets for this server to the given dialog.

◆ castExtraInfo() [1/2]

ExtraInfo * sf::GmiServer::castExtraInfo ( ResultData var) const
protected

Easy to use function to access the extra info from a result data. TODO: Use ResultData::getData<type>() template function for casting.

◆ castExtraInfo() [2/2]

ExtraInfo * sf::GmiServer::castExtraInfo ( Variable var) const
protected

Easy to use function to access the extra info from a variable. TODO: Use Variable::getData<type>() template function for casting.

◆ checkReadOnly()

void sf::GmiServer::checkReadOnly ( )
protected

Sets the variables to readonly based on the flags and lock status.

◆ clearValidations()

void sf::GmiServer::clearValidations ( )
protected

Clears the committed ranges of the attached results if there are any.

◆ createImplementation()

bool sf::GmiServer::createImplementation ( const std::string &  name = {})

Creates an attached implementation by name.

◆ createInterface()

void sf::GmiServer::createInterface ( )
protected

Create interface parameters at construction once.

◆ CreateResultData()

ResultData * sf::GmiServer::CreateResultData ( const gmi::ResultInfo info,
const std::string &  setup 
)
protected

Creates a variable with an extra info structure attached.

Parameters
info
setup
Returns

◆ createSetupString() [1/2]

std::string sf::GmiServer::createSetupString ( const gmi::ParamInfo info,
gmi::IdType  vid 
)
protected

Creates a setup string from the passed parameter info structure.

Parameters
info
vid
Returns

◆ createSetupString() [2/2]

std::string sf::GmiServer::createSetupString ( const gmi::ResultInfo info,
gmi::IdType  vid 
)
protected

Creates a setup string from the passed result info structure.

Parameters
info
vid
Returns

◆ createVariable()

bool sf::GmiServer::createVariable ( Variable *&  var,
const gmi::ParamInfo info,
const std::string &  setup 
)
protected

Creates a variable with an extra info structure attached.

Parameters
var
info
setup
Returns
True when

◆ destroyImplementation()

void sf::GmiServer::destroyImplementation ( )

Destroys the created implementation.

◆ destroyInterface()

void sf::GmiServer::destroyInterface ( )
protected

Remove all parameters and results.

◆ destroyResultData()

void sf::GmiServer::destroyResultData ( ResultData var)
protected

Destroys a variable including the attached extra info structure.

Parameters
var

◆ destroyVariable()

void sf::GmiServer::destroyVariable ( Variable var)
protected

Destroys a variable including the attached extra info structure.

Parameters
var

◆ evaluateInterfaceParams()

void sf::GmiServer::evaluateInterfaceParams ( )
protected

Evaluate parameters after the configuration has changed.

◆ evaluateInterfaceResults()

void sf::GmiServer::evaluateInterfaceResults ( )
protected

Evaluate results after the configuration has changed.

◆ getAxisCount()

unsigned sf::GmiServer::getAxisCount ( )
protected

Gets the amount of axes for this implementation.

◆ getAxisName()

std::string sf::GmiServer::getAxisName ( int  axis)
protected

Gets the axis name of the given axis.

Parameters
axisAxis number as in #sf::gmi::EAxisLocation
Returns
Name of the axis number.

◆ getController()

gmi::Controller * sf::GmiServer::getController ( )

Gets the created controller pointer.

Returns
When not created it returns a nullptr.

◆ getImplementationName()

std::string sf::GmiServer::getImplementationName ( ) const

Gets the name of the current implementation.

◆ GetNameOfs() [1/2]

std::string sf::GmiServer::GetNameOfs ( const gmi::ParamInfo info)
protected

Gets the name of the channel using the device name.

Parameters
infoParameter in formation.
Returns
Name offset.

◆ GetNameOfs() [2/2]

std::string sf::GmiServer::GetNameOfs ( const gmi::ResultInfo info)
protected

Returns the name of the channel using the device name.

Parameters
info
Returns

◆ getServerName()

std::string sf::GmiServer::getServerName ( ) const

Gets the name given at the constructor.

◆ getVariable()

const Variable & sf::GmiServer::getVariable ( int  pid)

Gets the owner variable that corresponds the motion interfaces parameter id.

Parameters
pidParameter id
Returns
Corresponding variable.

◆ getVariables()

const Variable::PtrVector & sf::GmiServer::getVariables ( ) const

Gets all associated variables of the implementation.

Returns
Vector containing #sf::Variable pointers.

◆ isLocked()

bool sf::GmiServer::isLocked ( ) const
inline

Returns true when all parameters are locked.

Returns
True when locked.

◆ paramNotify()

void sf::GmiServer::paramNotify ( id_type  id)
protected

Hook function for parameter indirectly called from the implementation.

Parameters
idParameter id

◆ paramNotifyProc()

static void sf::GmiServer::paramNotifyProc ( void *  data,
gmi::IdType  id 
)
staticprotected

◆ resultListFind()

ResultData::PtrVector::size_type sf::GmiServer::resultListFind ( id_type  id) const
protected

Looks up a result data which is represented the interface id.

Parameters
id
Returns

◆ resultNotify()

void sf::GmiServer::resultNotify ( id_type  id)
protected

Hook function for parameter indirectly called from the implementation.

Parameters
idResult id

◆ resultNotifyProc()

static void sf::GmiServer::resultNotifyProc ( void *  data,
gmi::IdType  id 
)
staticprotected

◆ serverResultDataHandler()

void sf::GmiServer::serverResultDataHandler ( ResultData::EEvent  event,
const ResultData caller,
ResultData link,
const Range rng,
bool  same_inst 
)
protected

Event handler for results.

◆ serverVariableHandler()

void sf::GmiServer::serverVariableHandler ( Variable::EEvent  event,
const Variable caller,
Variable linker,
bool  same_inst 
)
protected

Event handler for variables.

◆ setLocked()

void sf::GmiServer::setLocked ( bool  flag)

Locks the variables by making them all read only.

Parameters
flagLocking state.

◆ variableListFind()

Variable::PtrVector::size_type sf::GmiServer::variableListFind ( id_type  id) const
protected

Looks up a parameter which is represented the interface by the given id.

Parameters
id
Returns

Friends And Related Symbol Documentation

◆ MotionVariablePropertyPage

friend class MotionVariablePropertyPage
friend

Member Data Documentation

◆ _controller

gmi::Controller* sf::GmiServer::_controller
protected

Holds the controller implementation.

◆ _deviceNumber

int sf::GmiServer::_deviceNumber
protected

Holds the device number for this server.

◆ _handledParamId

gmi::IdType sf::GmiServer::_handledParamId
protected

The id of the interface parameter being processed by the param hook.

◆ _lock

bool sf::GmiServer::_lock
protected

Variable indicating lock status.

◆ _resultVector

ResultData::PtrVector sf::GmiServer::_resultVector
protected

Holds all created results for this instance.

◆ _serverName

std::string sf::GmiServer::_serverName
protected

Holds the device name for creating the variable names.

◆ _serverResultDataHandler

TResultDataHandler<GmiServer> sf::GmiServer::_serverResultDataHandler
protected

Callback hook for result events.

◆ _serverVariableHandler

TVariableHandler<GmiServer> sf::GmiServer::_serverVariableHandler
protected

Callback hook for variable events.

◆ _varHandlerEntryCount

int sf::GmiServer::_varHandlerEntryCount
protected

Holds the variable handler entry count.

◆ _variableVector

Variable::PtrVector sf::GmiServer::_variableVector
protected

Holds all created variables for the selected implementation.

◆ _vImplementation

Variable sf::GmiServer::_vImplementation
protected

Variable for selecting an implementation.

◆ _vMovePos

const Variable* sf::GmiServer::_vMovePos
protected

Holds the pointer to a position motion status variable.

◆ _vMoveVel

const Variable* sf::GmiServer::_vMoveVel
protected

Holds the pointer to a velocity motion status variable.

◆ _zero

Variable sf::GmiServer::_zero {0, false}
protected

Variable returned when not found.


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