![]() |
Scanframe Modular Application 0.1.0
|
#include <GmiServer.h>
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 Variable & | getVariable (int pid) |
Gets the owner variable that corresponds the motion interfaces parameter id. | |
const Variable::PtrVector & | getVariables () const |
Gets all associated variables of the implementation. | |
gmi::Controller * | getController () |
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. | |
ResultData * | CreateResultData (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. | |
ExtraInfo * | castExtraInfo (Variable *var) const |
Easy to use function to access the extra info from a variable. TODO: Use Variable::getData<type>() template function for casting. | |
ExtraInfo * | castExtraInfo (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 | |
![]() | |
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_type > | IdVector |
Vector for lists of information ID's. | |
typedef TVector< InformationBase * > | Vector |
Vector for containing different information base derived classes. | |
![]() | |
template<typename T > | |
static constexpr std::enable_if_t<(sizeof(T)<=sizeof(data_type)), data_type > | toDataType (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 constexpr size_t | npos = std::numeric_limits<size_type>::max() |
Unsigned size value indicating not found or no index. | |
|
explicit |
Constructor.
device_number | |
server_name |
sf::GmiServer::~GmiServer | ( | ) |
Destructor.
void sf::GmiServer::addPropertyPages | ( | PropertySheetDialog * | sheet | ) |
Add the property sheets for this server to the given dialog.
|
protected |
Easy to use function to access the extra info from a result data. TODO: Use ResultData::getData<type>() template function for casting.
Easy to use function to access the extra info from a variable. TODO: Use Variable::getData<type>() template function for casting.
|
protected |
Sets the variables to readonly based on the flags and lock status.
|
protected |
Clears the committed ranges of the attached results if there are any.
bool sf::GmiServer::createImplementation | ( | const std::string & | name = {} | ) |
Creates an attached implementation by name.
|
protected |
Create interface parameters at construction once.
|
protected |
Creates a variable with an extra info structure attached.
info | |
setup |
|
protected |
Creates a setup string from the passed parameter info structure.
info | |
vid |
|
protected |
Creates a setup string from the passed result info structure.
info | |
vid |
|
protected |
Creates a variable with an extra info structure attached.
var | |
info | |
setup |
void sf::GmiServer::destroyImplementation | ( | ) |
Destroys the created implementation.
|
protected |
Remove all parameters and results.
|
protected |
Destroys a variable including the attached extra info structure.
var |
|
protected |
Destroys a variable including the attached extra info structure.
var |
|
protected |
Evaluate parameters after the configuration has changed.
|
protected |
Evaluate results after the configuration has changed.
|
protected |
Gets the amount of axes for this implementation.
|
protected |
Gets the axis name of the given axis.
axis | Axis number as in #sf::gmi::EAxisLocation |
gmi::Controller * sf::GmiServer::getController | ( | ) |
Gets the created controller pointer.
std::string sf::GmiServer::getImplementationName | ( | ) | const |
Gets the name of the current implementation.
|
protected |
Gets the name of the channel using the device name.
info | Parameter in formation. |
|
protected |
Returns the name of the channel using the device name.
info |
std::string sf::GmiServer::getServerName | ( | ) | const |
Gets the name given at the constructor.
const Variable & sf::GmiServer::getVariable | ( | int | pid | ) |
Gets the owner variable that corresponds the motion interfaces parameter id.
pid | Parameter id |
const Variable::PtrVector & sf::GmiServer::getVariables | ( | ) | const |
Gets all associated variables of the implementation.
|
inline |
Returns true when all parameters are locked.
|
protected |
Hook function for parameter indirectly called from the implementation.
id | Parameter id |
|
staticprotected |
|
protected |
Looks up a result data which is represented the interface id.
id |
|
protected |
Hook function for parameter indirectly called from the implementation.
id | Result id |
|
staticprotected |
|
protected |
Event handler for results.
|
protected |
Event handler for variables.
void sf::GmiServer::setLocked | ( | bool | flag | ) |
Locks the variables by making them all read only.
flag | Locking state. |
|
protected |
Looks up a parameter which is represented the interface by the given id.
id |
|
friend |
|
protected |
Holds the controller implementation.
|
protected |
Holds the device number for this server.
|
protected |
The id of the interface parameter being processed by the param hook.
|
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 the variable handler entry count.
|
protected |
Holds all created variables for the selected implementation.
|
protected |
Holds the pointer to a position motion status variable.
|
protected |
Holds the pointer to a velocity motion status variable.