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

#include <GmiEmulator.h>

Inheritance diagram for sf::GmiEmulator:
Collaboration diagram for sf::GmiEmulator:

Classes

class  TAxis
 Axis type of this implementation. More...
 

Public Types

typedef Controller TInherited
 
- Public Types inherited from sf::gmi::Controller
enum  EStatus : int {
  csERROR = -1 , csUNINIT = 0 , csINIT , csUNHOMED ,
  csHOMING , csREADY
}
 States the controller can have. More...
 

Public Member Functions

 GmiEmulator (const Parameters &)
 
 ~GmiEmulator () override
 
bool doInitialize (bool) override
 Initialization function which must be overloaded by a derived class. Should check the hardware configuration.
 
bool doHomeAxes (bool skip) override
 Does the real execution of the home function and must be overloaded. When skip has been passed the implementation tries to skip homing.
 
void addPropertyPages (PropertySheetDialog *sheet) override
 Adds controller specific property pages to the passed sheet.
 
bool enumParamIds (IdList &ids) const override
 
gmi::IdType getParamId (EParam param, int axis=std::numeric_limits< int >::max()) const override
 
bool handleParam (gmi::IdType id, ParamInfo *info, const Value *setval, Value *getval) override
 This function must be overloaded to handle 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.
 
gmi::IdType getResultId (EResult result, int axis=std::numeric_limits< int >::max()) const override
 
bool enumResultIds (IdList &ids) const override
 
bool handleResult (gmi::IdType id, gmi::ResultInfo *info, gmi::BufferInfo *buf_info) override
 This function must be overloaded to handle the interface results.
 
void doMovePos (EMovePosCmd mpc)
 
void doMoveVel (EMoveVelCmd mvc)
 
void doMoveCon (EMoveConCmd mcc)
 
bool sustain (const timespec &t)
 
- Public Member Functions inherited from sf::gmi::Controller
 Controller (const Parameters &)
 Constructor for passing general structure for derived classes.
 
virtual ~Controller ()
 Virtual destructor for derived classes.
 
void destroy ()
 Must be called from a derived class in the destructor before anything.
 
bool initialize ()
 Initializes the hardware for operation and starts the thread when doInitialize returns true.
 
bool uninitialize ()
 Un-initializes the hardware.
 
void hookEventHandler (ControllerEvent handler)
 Attaches the event handler for events.
 
void unhookEventHandler (ControllerEvent handler)
 Detaches the event handler for events.
 
bool storeSettings (bool rd)
 Reads or writes the non exported parameters/settings to profile.
 
bool homeAxes (bool skip)
 Start homing procedure and returns true when successfully started. When skip has been passed the implementation tries to skip homing.
 
bool setJoystick (EJoystickCmd jsc)
 Enables or disables the joystick mode of the controller.
 
EJoystickCmd getJoystick () const
 Returns the joystick state. Off=0, Stop=1 and On=2.
 
EAxisLocation getJoystickAxis () const
 Returns the current selected axis on the joystick control. This does not mean it is enabled.
 
bool setJoystickAxis (EAxisLocation axis_loc)
 Sets the selected axis for the joystick enabled or not.
 
EAxisLocation getPopAxis () const
 Returns the current selected axis on the pop event source.
 
bool setPopAxis (EAxisLocation al)
 Sets the selected axis for the pop event source.
 
bool setTriggerEnable (bool enable)
 Sets the trigger enable.
 
bool getTriggerEnable () const
 Gets the trigger enable status.
 
double setTriggerFreq (double freq)
 Sets the trigger internal frequency generator and returns the clipped or rounded value.
 
double getTriggerFreq () const
 Returns the trigger internal frequency generator.
 
bool setMovePos (EMovePosCmd mpc)
 Executes a passed move position command.
 
EMovePosCmd getMovePos () const
 Returns the current active position command. When moving position the command returned will eventually become mcSTOP.
 
bool setMoveVel (EMoveVelCmd mvc)
 Executes a passed move velocity command.
 
EMoveVelCmd getMoveVel () const
 Returns the current active velocity command.
 
bool setMoveCon (EMoveConCmd mcc)
 Executes a passed move continuous command.
 
EMoveConCmd getMoveCon () const
 Returns the current active velocity command.
 
AxisgetAxis (int axis_loc)
 Gets a reference to the axis at the specified location.
 
const AxisgetAxis (int axis_loc) const
 Gets a const reference to the axis at the specified location.
 
AxisgetPhysicalAxis (int axis_num)
 Returns the physical axis location of the passed axis number.
 
bool getCurrent (EAxisValueType avt, AxesCoord &ac) const
 Gets the current axes values.
 
bool setCurrent (EAxisValueType avt, const AxesCoord &coord)
 Sets the current axes values.
 
bool getTarget (EAxisValueType avt, AxesCoord &coord) const
 Gets the target set for this axis.
 
bool setTarget (EAxisValueType avt, const AxesCoord &coord)
 Set the target value type.
 
bool setTarget (const AxesCoord &pos, const AxesCoord &vel, const AxesCoord &acc, bool linear)
 Set the target.
 
bool setMode (EAxisMode am, const AxesCoord &ac, EAxisMode amdef=amDISABLED)
 Sets the mode according the in the coord specified axes.
 
bool setTriggerAxis (EAxisLocation al)
 Sets the axis which pulses are used to derive the trigger pulses.
 
EAxisLocation getTriggerAxis () const
 Gets the current selected trigger axis.
 
double getTriggerDensity () const
 Gets the density of measurements in radians or meters depending on selected axis.
 
bool setTriggerDensity (double td)
 Sets the density of measurements in rads or m depending on selected axis.
 
bool setTriggerMode (bool intern)
 Sets Trigger mode.
 
bool getTriggerMode () const
 Gets the trigger mode.
 
bool setChuckJaw (EChuckJaw cj)
 Sets chuck-jaw state.
 
EChuckJaw getChuckJaw () const
 Gets chuck-jaw state.
 
bool isMovePosCompleted () const
 Returns true if the last position move is completed.
 
bool isMoveVelCompleted () const
 Returns true if the velocity move is completed.
 
bool isMoveConCompleted () const
 Returns true if the contineous move is completed.
 
bool isMoving () const
 Function testing for movement of position and velocity mode. When there is an abort state of-any-of the motion groups the axis is considered as not moving.
 
bool setPosition (EAxisLocation al, double value)
 Sets the current position of single axis.
 
bool setPosition (const AxesCoord &ac)
 Sets the current position of all axis.
 
AxesCoordnormalize (AxesCoord &pos) const
 normalize the passed position for all unlimited rotation axes. Uses accuracy to find the actual position to normalize. The passed value is also returned.
 
AxesCoord normalized (const AxesCoord &dist) const
 normalize the passed position for all unlimited rotation axes. Uses accuracy to find the actual position to normalize. The passed value is also returned.
 
AxisLocations getRadialUnlimited () const
 Gets a bitmap set of radial unlimited axis locations.
 
virtual void openDebugger ()
 Opens a debugger dialog for the motion controller if any.
 
bool isReady () const
 Returns true if the current status is READY.
 
const char * getStatusName () const
 Gets the current status as a name.
 
unsigned getAxisCount () const
 Gets the amount real implemented axes.
 
std::string getLastErrorText () const
 Gets the last error if there is one.
 
bool getParamInfo (IdType id, ParamInfo &info) const
 Retrieve information about the passed param id.
 
bool getParam (IdType id, Value &value) const
 Returns 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 an interface parameter and notifies hooked user when skip_event is false.
 
bool setGetParam (IdType id, Value &value, bool skip_event)
 Sets and immediately gets the same value again clipped or not. When skip event is true the callParamHook is not called.
 
virtual IdType getParamId (EParam param, int axis=std::numeric_limits< int >::max()) const =0
 Gets the ID of the parameter for the specified gate. Value std::numeric_limits<int>::max() tells the implementation to ignore the parameter.
 
virtual bool enumParamIds (IdList &ids) const =0
 Enumerate 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 (EResult result, int axis=std::numeric_limits< int >::max()) const =0
 Gets the ID of the result for the specified gate. Value std::numeric_limits<int>::max() tells the implementation to ignore the result.
 
virtual bool enumResultIds (IdList &ids) const =0
 Enumerate interface results ids.
 
bool getResultInfo (IdType id, ResultInfo &info) const
 Retrieve information about the passed result id.
 
bool getResultBuffer (IdType id, BufferInfo &buf_info)
 Gets the result buffer associated with the result ID passed in the result hook at the time of the call.
 
bool getAccuracy (AxesCoord &accuracy) const
 Gets the accuracy of positions of the implementation for a coords compare.
 
bool getResolution (AxesCoord &resolution) const
 Gets the resolution on all axis for the implementation.
 
bool getMinMax (EAxisMinMax amm, AxesCoord &coord) const
 Gets the current axes extremes.
 
bool setOffset (const AxesCoord &coord)
 Sets the position offset for all position related parameters of all axes.
 
bool getOffset (AxesCoord &coord) const
 Returns the current offset for all axes.
 
std::string getProfilePath () const
 Returns the configuration profile path of this implementation.
 

Public Attributes

TVector< TAxis * > AxisList
 
TAxis _axisX
 
TAxis _axisY
 
TAxis _axisZ
 
TAxis _axisA
 
TAxis _axisB
 
TAxis _axisC
 
TAxis _axisE
 
bool _flagInitialized
 
int _joystickState
 
int _triggerAxis
 
int _triggerMode
 
int _popAxis
 
double _triggerDensity
 
double _triggerFrequency
 
bool _triggerEnable
 
EMovePosCmd _curMovePos
 
EMoveVelCmd _curMoveVel
 
EMoveConCmd _curMoveCon
 
TSustain< GmiEmulator_sustainEntry
 
std::string _firmwareRevision
 
ElapseTimer _homingDelay
 
int _error
 
int _chuckJaw
 
int _popEventCount
 
int _debug
 
friend TAxis
 

Additional Inherited Members

- Static Public Member Functions inherited from sf::gmi::Controller
static const char * getAxisName (int axis_loc)
 Gets the name of the axis.
 
static const char * getAxisDescription (int axis_loc)
 Gets the description of the axis.
 
static const char * getStatusName (EStatus status)
 Gets the status name of the current status.
 
- Protected Member Functions inherited from sf::gmi::Controller
virtual bool doSetPosition (EAxisLocation al, double)
 Can be overloaded by a derived class. Sets the current position.
 
void setLastErrorText (const char *text)
 Derived classes can set the error text for the function.
 
void setStatus (EStatus status)
 Used by derived classes to set the controllers status.
 
EStatus getStatus () const
 Gets the status value.
 
void callParamHook (IdType id)
 Calls the hooked function if it exists. Passing the set data pointer and the ID of the effected parameter.
 
void callResultHook (IdType id)
 Calls the hooked function if it exists. Passing the set data pointer and the ID of the effected result.
 
void sendPopEvent ()
 Sends a POP event to the hooked event handlers. Is to be called by the implementation to signal that a new rotation has begun.
 

Member Typedef Documentation

◆ TInherited

Constructor & Destructor Documentation

◆ GmiEmulator()

sf::GmiEmulator::GmiEmulator ( const Parameters )
explicit

◆ ~GmiEmulator()

sf::GmiEmulator::~GmiEmulator ( )
override

Member Function Documentation

◆ addPropertyPages()

void sf::GmiEmulator::addPropertyPages ( PropertySheetDialog sheet)
overridevirtual

Adds controller specific property pages to the passed sheet.

Reimplemented from sf::gmi::Controller.

◆ doHomeAxes()

bool sf::GmiEmulator::doHomeAxes ( bool  skip)
overridevirtual

Does the real execution of the home function and must be overloaded. When skip has been passed the implementation tries to skip homing.

Reimplemented from sf::gmi::Controller.

◆ doInitialize()

bool sf::GmiEmulator::doInitialize ( bool  )
overridevirtual

Initialization function which must be overloaded by a derived class. Should check the hardware configuration.

Implements sf::gmi::Controller.

◆ doMoveCon()

void sf::GmiEmulator::doMoveCon ( EMoveConCmd  mcc)

◆ doMovePos()

void sf::GmiEmulator::doMovePos ( EMovePosCmd  mpc)

◆ doMoveVel()

void sf::GmiEmulator::doMoveVel ( EMoveVelCmd  mvc)

◆ enumParamIds()

bool sf::GmiEmulator::enumParamIds ( IdList &  ids) const
override

◆ enumResultIds()

bool sf::GmiEmulator::enumResultIds ( IdList &  ids) const
override

◆ getParamId()

gmi::IdType sf::GmiEmulator::getParamId ( EParam  param,
int  axis = std::numeric_limits< int >::max() 
) const
override

◆ getResultId()

gmi::IdType sf::GmiEmulator::getResultId ( EResult  result,
int  axis = std::numeric_limits< int >::max() 
) const
override

◆ handleParam()

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

This function must be overloaded to handle 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.

Implements sf::gmi::Controller.

◆ handleResult()

bool sf::GmiEmulator::handleResult ( gmi::IdType  id,
gmi::ResultInfo info,
gmi::BufferInfo buf_info 
)
overridevirtual

This function must be overloaded to handle the interface results.

Implements sf::gmi::Controller.

◆ sustain()

bool sf::GmiEmulator::sustain ( const timespec &  t)

Member Data Documentation

◆ _axisA

TAxis sf::GmiEmulator::_axisA

◆ _axisB

TAxis sf::GmiEmulator::_axisB

◆ _axisC

TAxis sf::GmiEmulator::_axisC

◆ _axisE

TAxis sf::GmiEmulator::_axisE

◆ _axisX

TAxis sf::GmiEmulator::_axisX

◆ _axisY

TAxis sf::GmiEmulator::_axisY

◆ _axisZ

TAxis sf::GmiEmulator::_axisZ

◆ _chuckJaw

int sf::GmiEmulator::_chuckJaw

◆ _curMoveCon

EMoveConCmd sf::GmiEmulator::_curMoveCon

◆ _curMovePos

EMovePosCmd sf::GmiEmulator::_curMovePos

◆ _curMoveVel

EMoveVelCmd sf::GmiEmulator::_curMoveVel

◆ _debug

int sf::GmiEmulator::_debug

◆ _error

int sf::GmiEmulator::_error

◆ _firmwareRevision

std::string sf::GmiEmulator::_firmwareRevision

◆ _flagInitialized

bool sf::GmiEmulator::_flagInitialized

◆ _homingDelay

ElapseTimer sf::GmiEmulator::_homingDelay

◆ _joystickState

int sf::GmiEmulator::_joystickState

◆ _popAxis

int sf::GmiEmulator::_popAxis

◆ _popEventCount

int sf::GmiEmulator::_popEventCount

◆ _sustainEntry

TSustain<GmiEmulator> sf::GmiEmulator::_sustainEntry

◆ _triggerAxis

int sf::GmiEmulator::_triggerAxis

◆ _triggerDensity

double sf::GmiEmulator::_triggerDensity

◆ _triggerEnable

bool sf::GmiEmulator::_triggerEnable

◆ _triggerFrequency

double sf::GmiEmulator::_triggerFrequency

◆ _triggerMode

int sf::GmiEmulator::_triggerMode

◆ AxisList

TVector<TAxis*> sf::GmiEmulator::AxisList

◆ TAxis


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