696 bool setParam(
EParam param,
int axis,
const Value& value,
bool skip_event);
702 bool getParam(
EParam param,
int axis,
Value& value)
const;
708 void attach(
Axis* axis);
713 Axis* getAxisPtr(
int axis_loc);
716 bool _flagDestroying;
724 std::string _lastErrorText;
732 void* _paramNotifyData;
734 void* _resultNotifyData;
736 bool _noEventGeneration;
738 ControllerListener::emitter_type _eventEmitter;
749#include <gmi/iface/Controller.hpp>
#define SF_DECL_IFACE(InterfaceType, ParamType, FuncName)
Declares a public static function in the class where it is used. Where: InterfaceType: Global typenam...
Definition TClassRegistration.h:71
Dialog containing multiple property pages.
Definition qt/PropertySheetDialog.h:15
Counted vector having additional methods and operators for ease of usage. This template class extends...
Definition TVector.h:19
Value container class able to performing arithmetic functions.
Definition Value.h:19
double flt_type
Type used internally for storing floating point value.
Definition Value.h:28
All axis values in one structure accompanied by some handy manipulation methods.
Definition AxesCoord.h:13
Interface class to access Axis properties and functions.
Definition Controller.h:73
bool setCurrent(EAxisValueType avt, value_type val)
Sets the current position/velocity/acceleration. Only when not moving.
bool setPosition(value_type value)
Sets the current position.
double getTarget(EAxisValueType avt) const
Returns the current velocity.
value_type getCurrent(EAxisValueType avt) const
Returns the current position/velocity/acceleration.
EAxisMode getMode() const
Returns the mode of operation.
TVector< Axis * > PtrVector
Easy to use vector for an array of Axis pointers.
Definition Controller.h:170
bool canModeChange(EAxisMode cur_mode, EAxisMode new_mode, bool pos_complete, bool vel_complete, bool con_complete)
Returns true if the mode can be changed.
value_type getAccuracy() const
Returns the accuracy for velocity and position.
value_type normalized(value_type pos) const
normalize the passed position for all unlimited rotation axes. Uses accuracy to find the actual posit...
value_type setOffset() const
Get the position offset.
virtual ~Axis()
Virtual destructor for possible derived destructors.
bool setTarget(EAxisValueType avt, value_type val)
Sets the current velocity.
const char * getName() const
Returns the name of this instance.
EAxisLocation getLocation() const
Returns the location of the axis in the constellation of axes.
AxisMovements getMovements() const
Returns the possible movements the is instance can make.
value_type getMinMax(EAxisMinMax amm) const
Gets the current extremes from this axis.
value_type getResolution() const
Returns the resolution of the axis.
bool setOffset(double ofs)
Set the position offset.
bool setMode(EAxisMode mode)
Sets the axis mode for operation. Returns false on failure.
Axis(Controller *mc, EAxisLocation)
Constructor that registers itself at the passed controller.
AxisMovements _movements
Holds the possible movements.
Definition Controller.h:186
const char * getDescription() const
Returns the description of this instance.
Pure virtual class for implementation of motion controllers.
Definition Controller.h:13
const char * getStatusName() const
Gets the current status as a name.
bool getMinMax(EAxisMinMax amm, AxesCoord &coord) const
Gets the current axes extremes.
static const char * getAxisDescription(int axis_loc)
Gets the description of the axis.
std::string getLastErrorText() const
Gets the last error if there is one.
bool setChuckJaw(EChuckJaw cj)
Sets chuck-jaw state.
bool getResultInfo(IdType id, ResultInfo &info) const
Retrieve information about the passed result id.
const ControllerListener::emitter_type & getEventEmitter() const
Attaches the event handler for events.
void sendPopEvent()
Sends a POP event to the hooked event handlers. Is to be called by the implementation to signal that ...
bool setTriggerEnable(bool enable)
Sets the trigger enable.
AxesCoord normalized(const AxesCoord &dist) const
normalize the passed position for all unlimited rotation axes. Uses accuracy to find the actual posit...
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 imp...
void destroy()
Must be called from a derived class in the destructor before anything.
EAxisLocation getTriggerAxis() const
Gets the current selected trigger axis.
AxesCoord & normalize(AxesCoord &pos) const
normalize the passed position for all unlimited rotation axes. Uses accuracy to find the actual posit...
bool setPosition(const AxesCoord &ac)
Sets the current position of all axis.
virtual bool handleParam(IdType id, ParamInfo *info, const Value *setval, Value *getval)=0
This function must be overridden to handle the interface parameters. When info in non-null the parame...
bool getParam(IdType id, Value &value) const
Returns the value of the specified parameter id. When the ID does not exist it returns false.
static const char * getAxisName(int axis_loc)
Gets the name of the axis.
bool setTarget(EAxisValueType avt, const AxesCoord &coord)
Set the target value type.
void setLastErrorText(const char *text)
Derived classes can set the error text for the function.
EChuckJaw getChuckJaw() const
Gets chuck-jaw state.
EAxisLocation getJoystickAxis() const
Returns the current selected axis on the joystick control. This does not mean it is enabled.
unsigned getAxisCount() const
Gets the amount real implemented axes.
static const char * getStatusName(EStatus status)
Gets the status name of the current status.
Axis & getPhysicalAxis(int axis_num)
Returns the physical axis location of the passed axis number.
bool setOffset(const AxesCoord &coord)
Sets the position offset for all position related parameters of all axes.
bool setMovePos(EMovePosCmd mpc)
Executes a passed move position command.
bool getAccuracy(AxesCoord &accuracy) const
Gets the accuracy of positions of the implementation for a coords compare.
bool setPopAxis(EAxisLocation al)
Sets the selected axis for the pop event source.
EMovePosCmd getMovePos() const
Returns the current active position command. When moving position the command returned will eventuall...
EAxisLocation getPopAxis() const
Returns the current selected axis on the pop event source.
bool isReady() const
Returns true if the current status is READY.
value_type setTriggerFreq(value_type freq)
Sets the trigger internal frequency generator and returns the clipped or rounded value.
void callParamHook(IdType id)
Calls the hooked function if it exists. Passing the set data pointer and the ID of the effected param...
Controller(const Parameters &)
Constructor for passing general structure for derived classes.
bool getTarget(EAxisValueType avt, AxesCoord &coord) const
Gets the target set for this axis.
EMoveConCmd getMoveCon() const
Returns the current active velocity command.
EStatus getStatus() const
Gets the status value.
virtual bool doSetPosition(EAxisLocation al, value_type)
Can be overridden by a derived class. Sets the current position.
bool isMoveVelCompleted() const
Returns true if the velocity move is completed.
bool setTriggerDensity(value_type td)
Sets the density of measurements in rads or m depending on selected axis.
value_type getTriggerFreq() const
Returns the trigger internal frequency generator.
bool setMode(EAxisMode am, const AxesCoord &ac, EAxisMode am_def=amDISABLED)
Sets the mode according the in the coord specified axes.
void setParamHook(NotifyProc proc, void *data)
Sets a procedure hook for the interface implementation to be called when the value changes as a resul...
virtual void openDebugger()
Opens a debugger dialog for the motion controller if any.
Definition Controller.h:467
Value::flt_type value_type
Use the floating point type of the Value class.
Definition Controller.h:16
bool setJoystick(EJoystickCmd jsc)
Enables or disables the joystick mode of the controller.
EStatus
States the controller can have.
Definition Controller.h:474
@ csUnhomed
Axes are not homed yet.
Definition Controller.h:482
@ csInitialized
Initialized.
Definition Controller.h:480
@ csHoming
Is currently homing.
Definition Controller.h:484
virtual bool doHomeAxes(bool skip)
Does the real execution of the home function and must be overridden. When skip has been passed the im...
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 callParamH...
bool setTriggerMode(bool intern)
Sets Trigger mode.
const Axis & getAxis(int axis_loc) const
Gets a const reference to the axis at the specified location.
bool homeAxes(bool skip)
Start homing procedure and returns true when successfully started. When skip has been passed the impl...
virtual ~Controller()
Virtual destructor for derived classes.
EJoystickCmd getJoystick() const
Returns the joystick state. Off=0, Stop=1 and On=2.
bool initialize()
Initializes the hardware for operation and starts the thread when doInitialize returns true.
virtual void addPropertyPages(PropertySheetDialog *sheet)
Adds controller specific property pages to the passed sheet.
bool isMovePosCompleted() const
Returns true if the last position move is completed.
virtual bool handleResult(IdType id, ResultInfo *info, BufferInfo *buf_info)=0
This function must be overridden to handle the interface results.
bool getCurrent(EAxisValueType avt, AxesCoord &ac) const
Gets the current axes values.
void callResultHook(IdType id)
Calls the hooked function if it exists. Passing the set data pointer and the ID of the effected resul...
bool setJoystickAxis(EAxisLocation axis_loc)
Sets the selected axis for the joystick enabled or not.
bool setTriggerAxis(EAxisLocation al)
Sets the axis which pulses are used to derive the trigger pulses.
bool getTriggerMode() const
Gets the trigger mode.
Axis & getAxis(int axis_loc)
Gets a reference to the axis at the specified location.
bool setCurrent(EAxisValueType avt, const AxesCoord &coord)
Sets the current axes values.
bool setMoveCon(EMoveConCmd mcc)
Executes a passed move continuous command.
virtual bool doInitialize(bool)=0
Initialization function which must be overridden by a derived class. Should check the hardware config...
bool getResolution(AxesCoord &resolution) const
Gets the resolution on all axis for the implementation.
bool isMoveConCompleted() const
Returns true if the contineous move is completed.
void setResultHook(NotifyProc proc, void *data)
Sets a procedure hook for the interface implementation to be called when there ias data result has da...
bool getParamInfo(IdType id, ParamInfo &info) const
Retrieve information about the passed param id.
bool setParam(IdType id, const Value &value, bool skip_event)
Sets an interface parameter and notifies hooked user when skip_event is false.
virtual bool enumResultIds(IdList &ids) const =0
Enumerate interface results ids.
bool setTarget(const AxesCoord &pos, const AxesCoord &vel, const AxesCoord &acc, bool linear)
Set the target.
bool storeSettings(bool rd)
Reads or writes the non exported parameters/settings to profile.
bool uninitialize()
Un-initializes the hardware.
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 ...
bool isMoving() const
Function testing for movement of position and velocity mode. When there is an abort state of-any-of t...
bool setMoveVel(EMoveVelCmd mvc)
Executes a passed move velocity command.
bool setPosition(EAxisLocation al, value_type value)
Sets the current position of single axis.
EMoveVelCmd getMoveVel() const
Returns the current active velocity command.
std::string getProfilePath() const
Returns the configuration profile path of this implementation.
AxisLocations getRadialUnlimited() const
Gets a bitmap set of radial unlimited axis locations.
void setStatus(EStatus status)
Used by derived classes to set the controllers status.
virtual bool enumParamIds(IdList &ids) const =0
Enumerate interface parameters ids.
bool getOffset(AxesCoord &coord) const
Returns the current offset for all axes.
value_type getTriggerDensity() const
Gets the density of measurements in radians or meters depending on selected axis.
bool getTriggerEnable() const
Gets the trigger enable status.
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 cal...
#define _GMI_CLASS
Definition gmi/iface/global.h:35
void(* NotifyProc)(void *data, IdType id)
Function type for the function type which is called when a parameter changes as a result of changes i...
Definition GmiInterface.h:283
EChuckJaw
Definition GmiInterface.h:635
EControllerEvent
Enumerate for controller events.
Definition GmiInterface.h:654
unsigned long long IdType
Type for gathering parameter ID's.
Definition GmiTypes.h:19
EMoveConCmd
Enumerate for controller continuous movement command.
Definition GmiInterface.h:537
EAxisValueType
List of axis coordinate types. Use a full namespace type path when specifying a Q_PROPERTY(....
Definition GmiTypes.h:31
EMovePosCmd
Enumerate for controller position movement command.
Definition GmiInterface.h:487
EAxisMode
Enumerate for controller mode of operation.
Definition GmiInterface.h:584
EAxisMinMax
Enumerate for retrieving axis extremes.
Definition GmiInterface.h:612
TSet< EAxisLocation > AxisLocations
Bitmap set of axis locations.
Definition GmiTypes.h:141
EResult
Motion default results.
Definition GmiInterface.h:464
EJoystickCmd
Enumerate for controller Joy movement command.
Definition GmiInterface.h:560
EMoveVelCmd
Enumerate for controller velocity movement command.
Definition GmiInterface.h:514
EParam
Motion default parameters. List of ids which must always be implemented for each motion implementatio...
Definition GmiInterface.h:290
EAxisLocation
Enumeration of axis locations.
Definition GmiTypes.h:81
@ alLastEntry
Last entry used in iterations.
Definition GmiTypes.h:131
Structure to hold data update information.
Definition GmiInterface.h:237
Arguments for when creating a controller implementation.
Definition Controller.h:22
Parameters(int mode)
Definition Controller.h:25
Structure to hold parameter information.
Definition GmiInterface.h:109
Structure to hold parameter information.
Definition GmiInterface.h:173