415 bool isMovePosCompleted()
const;
420 bool isMoveVelCompleted()
const;
425 bool isMoveConCompleted()
const;
494 inline bool isReady()
const;
514 const char* getStatusName()
const;
519 unsigned getAxisCount()
const;
524 std::string getLastErrorText()
const;
572 void setParamHook(NotifyProc proc,
void* data);
577 void setResultHook(NotifyProc proc,
void* data);
658 void setLastErrorText(
const char* text);
698 bool setParam(
EParam param,
int axis,
const Value& value,
bool skip_event);
704 bool getParam(
EParam param,
int axis,
Value& value)
const;
710 void attach(
Axis* axis);
715 Axis* getAxisPtr(
int axis_loc);
720 bool _flagDestroying;
736 std::string _lastErrorText;
752 void* _paramNotifyData;
756 void* _resultNotifyData;
760 bool _noEventGeneration;
808 _paramNotifyProc = proc;
809 _paramNotifyData = data;
814 _resultNotifyProc = proc;
815 _resultNotifyData = data;
835 return _axes.
count();
850 return _lastErrorText;
855 _lastErrorText = text;
#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:14
Counted vector having additional methods and operators for ease of usage.
Definition TVector.h:25
size_type count() const
Returns the amount of entries in the vector.
Definition TVector.h:625
Value container class able to performing arithmetic functions.
Definition Value.h:19
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:75
bool canModeChange(EAxisMode cur_mode, EAxisMode new_mode, bool pos_cmplt, bool vel_cmplt, bool con_cmplt)
Returns true if the mode can be changed.
bool setCurrent(EAxisValueType avt, double val)
Sets the current position/velocity/acceleration. Only when not moving.
double getTarget(EAxisValueType avt) const
Returns the current velocity.
double getResolution() const
Returns the resolution of the axis.
bool setTarget(EAxisValueType avt, double val)
Sets the current velocity.
EAxisMode getMode() const
Returns the mode of operation.
TVector< Axis * > PtrVector
Easy to use vector for an array of Axis pointers.
Definition Controller.h:172
double normalized(double pos) const
normalize the passed position for all unlimited rotation axes. Uses accuracy to find the actual posit...
double getAccuracy() const
Returns the accuracy for velocity and position.
virtual ~Axis()
Virtual destructor for possible derived destructors.
const char * getName() const
Returns the name of this instance.
EAxisLocation getLocation() const
Returns the location of the axis in the constellation of axes.
Definition Controller.h:869
AxisMovements getMovements() const
Returns the possible movements the is instance can make.
Definition Controller.h:874
double setOffset() const
Get the position offset.
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.
double getMinMax(EAxisMinMax amm) const
Gets the current extremes from this axis.
double getCurrent(EAxisValueType avt) const
Returns the current position/velocity/acceleration.
AxisMovements _movements
Holds the possible movements.
Definition Controller.h:188
const char * getDescription() const
Returns the description of this instance.
bool setPosition(double value)
Sets the current position.
Pure virtual class for implementation of motion controllers.
Definition Controller.h:13
const char * getStatusName() const
Gets the current status as a name.
Definition Controller.h:858
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.
Definition Controller.h:848
double getTriggerDensity() const
Gets the density of measurements in radians or meters depending on selected axis.
bool setChuckJaw(EChuckJaw cj)
Sets chuck-jaw state.
bool getResultInfo(IdType id, ResultInfo &info) const
Retrieve information about the passed result id.
Definition Controller.h:781
void sendPopEvent()
Sends a POP event to the hooked event handlers. Is to be called by the implementation to signal that ...
Definition Controller.h:801
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...
Definition Controller.h:863
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.
virtual bool doSetPosition(EAxisLocation al, double)
Can be overloaded by a derived class. Sets the current position.
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.
void hookEventHandler(ControllerEvent handler)
Attaches the event handler for events.
virtual bool handleParam(IdType id, ParamInfo *info, const Value *setval, Value *getval)=0
This function must be overloaded 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.
Definition Controller.h:796
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.
Definition Controller.h:853
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.
double getTriggerFreq() const
Returns the trigger internal frequency generator.
unsigned getAxisCount() const
Gets the amount real implemented axes.
Definition Controller.h:833
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.
Definition Controller.h:776
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.
bool setTriggerDensity(double td)
Sets the density of measurements in rads or m depending on selected axis.
bool isMoveVelCompleted() const
Returns true if the velocity move is completed.
Definition Controller.h:823
void setParamHook(NotifyProc proc, void *data)
Sets a procedure hook for the interface implementation to be called when the value changes as a resul...
Definition Controller.h:806
virtual void openDebugger()
Opens a debugger dialog for the motion controller if any.
Definition Controller.h:469
bool setJoystick(EJoystickCmd jsc)
Enables or disables the joystick mode of the controller.
EStatus
States the controller can have.
Definition Controller.h:476
@ csHOMING
Is currently homing.
Definition Controller.h:486
@ csINIT
Initialized.
Definition Controller.h:482
@ csUNHOMED
Axes are not homed yet.
Definition Controller.h:484
@ csREADY
Is ready for action.
Definition Controller.h:488
virtual bool doHomeAxes(bool skip)
Does the real execution of the home function and must be overloaded. 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.
void unhookEventHandler(ControllerEvent handler)
Detaches the event handler for events.
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.
EStatus getStatus() const
Gets the status value.
Definition Controller.h:843
double setTriggerFreq(double freq)
Sets the trigger internal frequency generator and returns the clipped or rounded value.
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.
Definition Controller.h:818
bool setPosition(EAxisLocation al, double value)
Sets the current position of single axis.
virtual bool handleResult(IdType id, ResultInfo *info, BufferInfo *buf_info)=0
This function must be overloaded 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 setMode(EAxisMode am, const AxesCoord &ac, EAxisMode amdef=amDISABLED)
Sets the mode according the in the coord specified axes.
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 overloaded 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.
Definition Controller.h:828
void setResultHook(NotifyProc proc, void *data)
Sets a procedure hook for the interface implementation to be called when there ias data result has da...
Definition Controller.h:812
bool getParamInfo(IdType id, ParamInfo &info) const
Retrieve information about the passed param id.
Definition Controller.h:791
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.
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.
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...
Definition Controller.h:786
#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:277
EChuckJaw
Definition GmiInterface.h:629
unsigned long long IdType
Type for gathering parameter ID's.
Definition GmiTypes.h:19
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:481
@ mpcCOMPLETE
Stop current movement smooth.
Definition GmiInterface.h:485
EAxisMode
Enumerate for controller mode of operation.
Definition GmiInterface.h:578
EAxisMinMax
Enumerate for retrieving axis extremes.
Definition GmiInterface.h:606
TSet< EAxisLocation > AxisLocations
Bitmap set of axis locations.
Definition GmiTypes.h:141
EResult
Motion default results.
Definition GmiInterface.h:458
EMoveVelCmd
Enumerate for controller velocity movement command.
Definition GmiInterface.h:508
@ mvcCOMPLETE
No movement.
Definition GmiInterface.h:512
EMoveConCmd
Enumerate for controller continuous movement command.
Definition GmiInterface.h:531
@ mccCOMPLETE
No movement.
Definition GmiInterface.h:535
EJoystickCmd
Enumerate for controller Joy movement command.
Definition GmiInterface.h:554
EParam
Motion default parameters. List of ids which must always be implemented for each motion implementatio...
Definition GmiInterface.h:284
EAxisLocation
Enumeration of axis locations.
Definition GmiTypes.h:81
@ alLastEntry
Last entry used in iterations.
Definition GmiTypes.h:131
EControllerEvent
Enumerate for controller events.
Definition GmiInterface.h:647
@ cePOPEVENT
POP axis has made a rotation.
Definition GmiInterface.h:667
TSet< EAxisMovement > AxisMovements
Bitmap set of axis movements.
Definition GmiTypes.h:75
Structure to hold data update information.
Definition GmiInterface.h:231
Arguments for when creating a controller implementation.
Definition Controller.h:19
Parameters(int mode)
Definition Controller.h:22
Structure to hold parameter information.
Definition GmiInterface.h:107
Structure to hold parameter information.
Definition GmiInterface.h:171