TwiceAsNice  2019-02-18
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Basda::MoConNDevice Class Reference

This is the MoCon device, which support to control N motors. More...

#include <NDevice.h>

Inheritance diagram for Basda::MoConNDevice:
Inheritance graph
Collaboration diagram for Basda::MoConNDevice:
Collaboration graph

Public Member Functions

 MoConNDevice (const Nice::JointPtr &_config)
 Constructor. More...
 
 ~MoConNDevice ()
 Destructor. More...
 
std::string createConnectionID (const std::string &_address, const unsigned int _cardNo, const unsigned int _moduleNo)
 This method creates an ID based on the connection address, card number and module number separated by a colon to identify the module/card object in a map. More...
 
virtual void open ()
 This method might be called when the service goes in the INIT state. More...
 
virtual void close ()
 This method might be called when the service goes in the OFFLINE state. More...
 
virtual void reset (Basda::DeviceAsync &=Basda::Device::s_async)
 This method might be called when the service will be reseted. More...
 
virtual void version ()
 This method returns the version string of the device. More...
 
virtual void init (DeviceAsync &=Basda::Device::s_async)
 This method initialize the device and set the state to INIT. More...
 
virtual void deinit (DeviceAsync &=Basda::Device::s_async)
 This method deinitialize the device and set the state to OFFLINE. More...
 
virtual void activate (DeviceAsync &=Basda::Device::s_async)
 activate something More...
 
virtual void deactivate (DeviceAsync &=Basda::Device::s_async)
 deactivate something More...
 
virtual void chat (std::string _cardNo, std::string _commandID, std::string _moduleNo, std::string _selectID, std::string _parameter, std::string _numberOfLines, Basda::DeviceAsync &=Basda::Device::s_async)
 This method send the command string to the electronic. More...
 
virtual std::string dontParse (Basda::DeviceAsync &=Basda::Device::s_async)
 This method was requested by Lorenzo Busoni (lbuso.nosp@m.ni@a.nosp@m.rcetr.nosp@m.i.as.nosp@m.tro.i.nosp@m.t 02.03.2012) More...
 
virtual std::string receiveDataRaw (std::string _cardNo, std::string _commandID, std::string _moduleNo, std::string _numberOfLines, Basda::DeviceAsync &=Basda::Device::s_async)
 This method was requested by Lorenzo Busoni (lbuso.nosp@m.ni@a.nosp@m.rcetr.nosp@m.i.as.nosp@m.tro.i.nosp@m.t 02.03.2012) More...
 
virtual void moveToHome (Basda::DeviceAsync &_aync=Basda::Device::s_async)
 All motors of the device are looking for the reference positions and reset the step counter to zero. More...
 
virtual void moveToHomeStart (Basda::DeviceAsync &=Basda::Device::s_async)
 
virtual void moveToHomeWait (Basda::DeviceAsync &=Basda::Device::s_async)
 
virtual void moveToHomeSingle (int _motor, Basda::DeviceAsync &_async=Basda::Device::s_async)
 A single motor of the device is looking for the reference positions and reset the step counter to zero. More...
 
virtual void moveToHomeSingleStart (int _motor, Basda::DeviceAsync &=Basda::Device::s_async)
 
virtual void moveToHomeSingleWait (Basda::DeviceAsync &=Basda::Device::s_async)
 
virtual void moveToPositiveLimit (Basda::DeviceAsync &_async=Basda::Device::s_async)
 All motors of the device move to the positive software limit switch. More...
 
virtual void moveToPositiveLimitStart (Basda::DeviceAsync &_async=Basda::Device::s_async)
 
virtual void moveToPositiveLimitWait (Basda::DeviceAsync &_async=Basda::Device::s_async)
 
virtual void moveToNegativeLimit (Basda::DeviceAsync &_async=Basda::Device::s_async)
 All motors of the device move to the negative software limit switch. More...
 
virtual void moveToNegativeLimitStart (Basda::DeviceAsync &_async=Basda::Device::s_async)
 
virtual void moveToNegativeLimitWait (Basda::DeviceAsync &_async=Basda::Device::s_async)
 
virtual void moveToLimit (const Nice::NPoint &_limit, Basda::DeviceAsync &_async=Basda::Device::s_async)
 move all motors to the positive limit switches (_limits[i]>0) or negative (_limits[i]<0) limit switches. More...
 
virtual void moveToLimitStart (const Nice::NPoint &_limit, Basda::DeviceAsync &=Basda::Device::s_async)
 
virtual void moveToLimitWait (Basda::DeviceAsync &=Basda::Device::s_async)
 
virtual void moveOutOfLimit (int _motor, Basda::DeviceAsync &_async)
 move all motors out of the limit switches. More...
 
virtual void moveAbsolute (const Nice::NPoint &_positions, Basda::DeviceAsync &_async=Basda::Device::s_async)
 The motors that are stored in the vector, move to the absolute position. More...
 
virtual void moveAbsoluteStart (const Nice::NPoint &_positions, Basda::DeviceAsync &=Basda::Device::s_async)
 
virtual void moveAbsoluteWait (Basda::DeviceAsync &=Basda::Device::s_async)
 
virtual void moveRelative (const Nice::NPoint &_positions, Basda::DeviceAsync &_async=Basda::Device::s_async)
 The motors that are stored in the vector move to the relative position. More...
 
virtual void moveRelativeStart (const Nice::NPoint &_positions, Basda::DeviceAsync &=Basda::Device::s_async)
 
virtual void moveRelativeWait (Basda::DeviceAsync &=Basda::Device::s_async)
 
virtual void prepareMoveSync (Nice::BitSet _motors)
 This method set the motors, which will be moved or stopped synchronously. More...
 
virtual void startMoveSync ()
 Start the movement of the motors that are programmed with prepareMoveSync() and the move, stop and abort commands before. More...
 
void prepareDirectMove (const Nice::NPoint &_acceleration, const Nice::NPoint &_velocity, const Nice::NPoint &_deceleration)
 This method setup the acceleration anv velocity for a direct point to point move. More...
 
virtual void stop ()
 This method stops the motor with a deceleration. More...
 
virtual void abort ()
 Abort the moving of the motor immediately without deceleration. More...
 
virtual Nice::NPoint getPosition ()
 This method is deprecated and will be exchanged with getDeviceencoderPosition() More...
 
virtual Nice::NPoint getDeviceEncoderPosition ()
 Returns the current positions of all motors. More...
 
virtual void setPosition (const Nice::NPoint &_position)
 Change the absolute position of all motors. More...
 
virtual Nice::NPoint getAbsoluteEncoderPosition ()
 Returns the current positions of all motors. More...
 
virtual Nice::NPoint getIncrementalEncoderPosition ()
 Returns the current positions of all motors. More...
 
virtual Nice::NPoint getVelocity ()
 Returns the current velocity of all motors. More...
 
virtual Nice::SeqSeqDouble getBasicSettings ()
 This method returns the basic settings of all MoCon module. More...
 
virtual void setVelocitySetting (const Nice::NPoint &_velocity)
 Set the velocity configuration parameter of all motors. More...
 
virtual void setAccelerationSetting (const Nice::NPoint &_acceleration)
 Set the acceleration configuration parameter of all motors. More...
 
virtual void setDecelerationSetting (const Nice::NPoint &_deceleration)
 Set the deceleration configuration parameter of all motors. More...
 
virtual void setJerkSetting (const Nice::NPoint &_jerk)
 Set the jerk configuration parameter of all motors. More...
 
virtual bool isMoving (Nice::BitSet &_motion)
 Checks if one of the motors is in motion. More...
 
virtual bool isAtLimit (Nice::NPoint &_limit)
 Checks if one of the motors is in limit. More...
 
virtual bool isAtHome (Nice::BitSet &_atHome)
 This method indicate whether the motor is at the home position. More...
 
virtual void startExternalProfile (const Nice::Date &_date, const Nice::NPoint &_positionSequence, unsigned int _frequency, unsigned int _maxSamplesPerSegment, unsigned int _faultTolerance, Basda::DeviceAsync &_async=Basda::Device::s_async)
 This method setup and starts the external profile for a XY device. More...
 
void waitForNextTrigger (Nice::Date _date, Basda::DeviceAsync &_async=Basda::Device::s_async)
 This method wait until the next trigger has tobe raised. More...
 
virtual void changeExternalProfile (const Nice::Date &_date, const Nice::NPoint &_positionSequence)
 This method fit, validates and buffers the external profile. More...
 
virtual void prepareExternalProfile (const Nice::SeqSeqInt &_segmentsX, const Nice::SeqSeqInt &_segmentsY, Basda::DeviceAsync &_async=Basda::Device::s_async)
 This method prepares a direct point to point movement of a xy device. More...
 
virtual void startExternalProfile (Basda::DeviceAsync &_async=Basda::Device::s_async)
 This method starts a trajectory now. More...
 
virtual void setLinkTimeout (Nice::Time _tcpConnectionTimeout)
 This method sets TCP connection timeout. More...
 
virtual Nice::SeqTime getLinkTimeout ()
 This method returns TCP connection timeout. More...
 
virtual Nice::NPoint getReferenceTime ()
 This method synchronize the MoCon time with the PC time. More...
 
virtual Nice::NPoint getCurrentTime ()
 This method returns the current MoCon time. More...
 
virtual Nice::SeqBitSet getPositionSwitchStatus ()
 Returns the status of the position switch. More...
 
virtual bool isReachable ()
 Returns if the device is reachable. More...
 
void dumpStatusInformation (Basda::DeviceAsync &=Basda::Device::s_async, bool _compareParameter=false)
 This method downloads all configuration parameter of the MoCon. More...
 
void setCollision (Nice::SeqPoint _collisions)
 This method indicates all motor whether they have a collision or not. More...
 
virtual Nice::JointPtrVector description ()
 
void setChatType (std::map< std::string, Nice::ChatLinePtr > _chat)
 This method allows to use a different kind of Chat class. More...
 
virtual Nice::Completion getProgress ()
 
 MoConNDevice (const Nice::JointPtr &_config)
 Constructor. More...
 
 ~MoConNDevice ()
 Destructor. More...
 
std::string createConnectionID (const std::string &_address, const unsigned int _cardNo, const unsigned int _moduleNo)
 This method creates an ID based on the connection address, card number and module number separated by a colon to identify the module/card object in a map. More...
 
virtual void open ()
 This method might be called when the service goes in the INIT state. More...
 
virtual void close ()
 This method might be called when the service goes in the OFFLINE state. More...
 
virtual void reset (Basda::DeviceAsync &=Basda::Device::s_async)
 This method might be called when the service will be reseted. More...
 
virtual void version ()
 This method returns the version string of the device. More...
 
virtual void init (DeviceAsync &=Basda::Device::s_async)
 This method initialize the device and set the state to INIT. More...
 
virtual void deinit (DeviceAsync &=Basda::Device::s_async)
 This method deinitialize the device and set the state to OFFLINE. More...
 
virtual void activate (DeviceAsync &=Basda::Device::s_async)
 activate something More...
 
virtual void deactivate (DeviceAsync &=Basda::Device::s_async)
 deactivate something More...
 
virtual void chat (std::string _cardNo, std::string _commandID, std::string _moduleNo, std::string _selectID, std::string _parameter, std::string _numberOfLines, Basda::DeviceAsync &=Basda::Device::s_async)
 This method send the command string to the electronic. More...
 
virtual std::string dontParse (Basda::DeviceAsync &=Basda::Device::s_async)
 This method was requested by Lorenzo Busoni (lbuso.nosp@m.ni@a.nosp@m.rcetr.nosp@m.i.as.nosp@m.tro.i.nosp@m.t 02.03.2012) More...
 
virtual std::string receiveDataRaw (std::string _cardNo, std::string _commandID, std::string _moduleNo, std::string _numberOfLines, Basda::DeviceAsync &=Basda::Device::s_async)
 This method was requested by Lorenzo Busoni (lbuso.nosp@m.ni@a.nosp@m.rcetr.nosp@m.i.as.nosp@m.tro.i.nosp@m.t 02.03.2012) More...
 
virtual void moveToHome (Basda::DeviceAsync &_aync=Basda::Device::s_async)
 All motors of the device are looking for the reference positions and reset the step counter to zero. More...
 
virtual void moveToHomeStart (Basda::DeviceAsync &=Basda::Device::s_async)
 
virtual void moveToHomeWait (Basda::DeviceAsync &=Basda::Device::s_async)
 
virtual void moveToHomeSingle (int _motor, Basda::DeviceAsync &_async=Basda::Device::s_async)
 A single motor of the device is looking for the reference positions and reset the step counter to zero. More...
 
virtual void moveToHomeSingleStart (int _motor, Basda::DeviceAsync &=Basda::Device::s_async)
 
virtual void moveToHomeSingleWait (Basda::DeviceAsync &=Basda::Device::s_async)
 
virtual void moveToPositiveLimit (Basda::DeviceAsync &_async=Basda::Device::s_async)
 All motors of the device move to the positive software limit switch. More...
 
virtual void moveToPositiveLimitStart (Basda::DeviceAsync &_async=Basda::Device::s_async)
 
virtual void moveToPositiveLimitWait (Basda::DeviceAsync &_async=Basda::Device::s_async)
 
virtual void moveToNegativeLimit (Basda::DeviceAsync &_async=Basda::Device::s_async)
 All motors of the device move to the negative software limit switch. More...
 
virtual void moveToNegativeLimitStart (Basda::DeviceAsync &_async=Basda::Device::s_async)
 
virtual void moveToNegativeLimitWait (Basda::DeviceAsync &_async=Basda::Device::s_async)
 
virtual void moveToLimit (const Nice::NPoint &_limit, Basda::DeviceAsync &_async=Basda::Device::s_async)
 move all motors to the positive limit switches (_limits[i]>0) or negative (_limits[i]<0) limit switches. More...
 
virtual void moveToLimitStart (const Nice::NPoint &_limit, Basda::DeviceAsync &=Basda::Device::s_async)
 
virtual void moveToLimitWait (Basda::DeviceAsync &=Basda::Device::s_async)
 
virtual void moveOutOfLimit (int _motor, Basda::DeviceAsync &_async)
 move all motors out of the limit switches. More...
 
virtual void moveAbsolute (const Nice::NPoint &_positions, Basda::DeviceAsync &_async=Basda::Device::s_async)
 The motors that are stored in the vector, move to the absolute position. More...
 
virtual void moveAbsoluteStart (const Nice::NPoint &_positions, Basda::DeviceAsync &=Basda::Device::s_async)
 
virtual void moveAbsoluteWait (Basda::DeviceAsync &=Basda::Device::s_async)
 
virtual void moveRelative (const Nice::NPoint &_positions, Basda::DeviceAsync &_async=Basda::Device::s_async)
 The motors that are stored in the vector move to the relative position. More...
 
virtual void moveRelativeStart (const Nice::NPoint &_positions, Basda::DeviceAsync &=Basda::Device::s_async)
 
virtual void moveRelativeWait (Basda::DeviceAsync &=Basda::Device::s_async)
 
virtual void prepareMoveSync (Nice::BitSet _motors)
 This method set the motors, which will be moved or stopped synchronously. More...
 
virtual void startMoveSync ()
 Start the movement of the motors that are programmed with prepareMoveSync() and the move, stop and abort commands before. More...
 
void prepareDirectMove (const Nice::NPoint &_acceleration, const Nice::NPoint &_velocity, const Nice::NPoint &_deceleration)
 This method setup the acceleration anv velocity for a direct point to point move. More...
 
virtual void stop ()
 This method stops the motor with a deceleration. More...
 
virtual void abort ()
 Abort the moving of the motor immediately without deceleration. More...
 
virtual Nice::NPoint getPosition ()
 This method is deprecated and will be exchanged with getDeviceencoderPosition() More...
 
virtual Nice::NPoint getDeviceEncoderPosition ()
 Returns the current positions of all motors. More...
 
virtual void setPosition (const Nice::NPoint &_position)
 Change the absolute position of all motors. More...
 
virtual Nice::NPoint getAbsoluteEncoderPosition ()
 Returns the current positions of all motors. More...
 
virtual Nice::NPoint getIncrementalEncoderPosition ()
 Returns the current positions of all motors. More...
 
virtual Nice::NPoint getVelocity ()
 Returns the current velocity of all motors. More...
 
virtual Nice::SeqSeqDouble getBasicSettings ()
 This method returns the basic settings of all MoCon module. More...
 
virtual void setVelocitySetting (const Nice::NPoint &_velocity)
 Set the velocity configuration parameter of all motors. More...
 
virtual void setAccelerationSetting (const Nice::NPoint &_acceleration)
 Set the acceleration configuration parameter of all motors. More...
 
virtual void setDecelerationSetting (const Nice::NPoint &_deceleration)
 Set the deceleration configuration parameter of all motors. More...
 
virtual void setJerkSetting (const Nice::NPoint &_jerk)
 Set the jerk configuration parameter of all motors. More...
 
virtual bool isMoving (Nice::BitSet &_motion)
 Checks if one of the motors is in motion. More...
 
virtual bool isAtLimit (Nice::NPoint &_limit)
 Checks if one of the motors is in limit. More...
 
virtual bool isAtHome (Nice::BitSet &_atHome)
 This method indicate whether the motor is at the home position. More...
 
virtual void startExternalProfile (const Nice::Date &_date, const Nice::NPoint &_positionSequence, unsigned int _frequency, unsigned int _maxSamplesPerSegment, unsigned int _faultTolerance, Basda::DeviceAsync &_async=Basda::Device::s_async)
 This method setup and starts the external profile for a XY device. More...
 
void waitForNextTrigger (Nice::Date _date, Basda::DeviceAsync &_async=Basda::Device::s_async)
 This method wait until the next trigger has tobe raised. More...
 
virtual void changeExternalProfile (const Nice::Date &_date, const Nice::NPoint &_positionSequence)
 This method fit, validates and buffers the external profile. More...
 
virtual void prepareExternalProfile (const Nice::SeqSeqInt &_segmentsX, const Nice::SeqSeqInt &_segmentsY, Basda::DeviceAsync &_async=Basda::Device::s_async)
 This method prepares a direct point to point movement of a xy device. More...
 
virtual void startExternalProfile (Basda::DeviceAsync &_async=Basda::Device::s_async)
 This method starts a trajectory now. More...
 
virtual void setLinkTimeout (Nice::Time _tcpConnectionTimeout)
 This method sets TCP connection timeout. More...
 
virtual Nice::SeqTime getLinkTimeout ()
 This method returns TCP connection timeout. More...
 
virtual Nice::NPoint getReferenceTime ()
 This method synchronize the MoCon time with the PC time. More...
 
virtual Nice::NPoint getCurrentTime ()
 This method returns the current MoCon time. More...
 
virtual Nice::SeqBitSet getPositionSwitchStatus ()
 Returns the status of the position switch. More...
 
virtual bool isReachable ()
 Returns if the device is reachable. More...
 
void dumpStatusInformation (Basda::DeviceAsync &=Basda::Device::s_async, bool _compareParameter=false)
 This method downloads all configuration parameter of the MoCon. More...
 
void setCollision (Nice::SeqPoint _collisions)
 This method indicates all motor whether they have a collision or not. More...
 
virtual Nice::JointPtrVector description ()
 
void setChatType (std::map< std::string, Nice::ChatLinePtr > _chat)
 This method allows to use a different kind of Chat class. More...
 
virtual Nice::Completion getProgress ()
 
- Public Member Functions inherited from Basda::MoccaNDevice
 MoccaNDevice (const Nice::JointPtr &_config)
 Constructor. More...
 
virtual ~MoccaNDevice ()
 Constructor. More...
 
 MoccaNDevice (const Nice::JointPtr &_config)
 Constructor. More...
 
virtual ~MoccaNDevice ()
 Constructor. More...
 
 MoccaNDevice (const Nice::JointPtr &_config)
 Constructor. More...
 
virtual ~MoccaNDevice ()
 Constructor. More...
 
- Public Member Functions inherited from Basda::MoccaDevice
 MoccaDevice (const Nice::JointPtr &_config)
 Constructor. More...
 
virtual ~MoccaDevice ()
 
 MoccaDevice (const Nice::JointPtr &_config)
 Constructor. More...
 
virtual ~MoccaDevice ()
 
 MoccaDevice (const Nice::JointPtr &_config)
 Constructor. More...
 
virtual ~MoccaDevice ()
 
- Public Member Functions inherited from Basda::Device
 Device (const Nice::JointPtr &_config)
 constructor. This is an elementary (lazy) action which stores the name and gets configuration. More...
 
virtual ~Device ()
 destructor Does nothing More...
 
virtual void setConfig (const Nice::JointPtr &_config)
 init with config tree ptr More...
 
Nice::JointPtrconfig ()
 retrieve the property tree More...
 
std::string & name ()
 retrieve the name set at ctor time. More...
 
 Device (const Nice::JointPtr &_config)
 constructor. This is an elementary (lazy) action which stores the name and gets configuration. More...
 
virtual ~Device ()
 destructor Does nothing More...
 
virtual void setConfig (const Nice::JointPtr &_config)
 init with config tree ptr More...
 
Nice::JointPtrconfig ()
 retrieve the property tree More...
 
std::string & name ()
 retrieve the name set at ctor time. More...
 

Private Member Functions

void createInstances ()
 
void addProperties ()
 This method add the following internal status properties. More...
 
void completion (std::string _cmd, Basda::DeviceAsync &=Basda::Device::s_async)
 Calculate the completion percent. More...
 
bool isMotionComplete (Nice::BitSet &_motion)
 Checks if the motion is complete. More...
 
void setMotionComplete (bool _complete)
 Resets the motion complete flag. More...
 
void setIsReachable (const bool _isReachable)
 
void resetFatalError ()
 This method resets the fatal error. More...
 
void generateExternalProfile (const Nice::Date &_date, const Nice::NPoint &_positionSequence)
 This method fit, validates and buffers the external profile. More...
 
void createInstances ()
 
void addProperties ()
 This method add the following internal status properties. More...
 
void completion (std::string _cmd, Basda::DeviceAsync &=Basda::Device::s_async)
 Calculate the completion percent. More...
 
bool isMotionComplete (Nice::BitSet &_motion)
 Checks if the motion is complete. More...
 
void setMotionComplete (bool _complete)
 Resets the motion complete flag. More...
 
void setIsReachable (const bool _isReachable)
 
void resetFatalError ()
 This method resets the fatal error. More...
 
void generateExternalProfile (const Nice::Date &_date, const Nice::NPoint &_positionSequence)
 This method fit, validates and buffers the external profile. More...
 

Private Attributes

std::map< std::string, MPIACoreProtocolPtrm_protocol
 This method resets the fatal error. More...
 
std::map< std::string, MoConCardPtrm_card
 This member keeps all card objects. More...
 
std::map< std::string, MoConModulePtrm_module
 This member keeps all module objects. More...
 
std::map< std::string, Nice::ChatLinePtrm_chat
 This member keeps all chat objects. More...
 
unsigned int m_externalProfileSize
 
int m_externalProfileInfo
 Keeps the last external profile info value to reduce the number of log messages. More...
 
bool m_isReachable
 
Nice::Completion m_completion
 This member is used to indicate which stop method should be used. More...
 
Nice::NPoint m_targetPositions
 
Nice::NPoint m_startPosition
 
Nice::NPoint m_currentPosition
 
bool m_extended
 
Nice::Mutex m_mutex
 

Additional Inherited Members

- Static Public Attributes inherited from Basda::Device
static DeviceAsyncImpl s_async
 
- Protected Types inherited from Basda::MoccaDevice
enum  CMDS {
  OPEN, CLOSE, RESET, INIT,
  DEINIT, ACTIVATE, DEACTIVATE, MOVETOHOME,
  MOVETOHOMESINGLE, MOVETOLIMIT, MOVETOPOSITIVELIMIT, MOVETONEGATIVELIMIT,
  STOP, ABORT, OPEN, CLOSE,
  RESET, INIT, DEINIT, ACTIVATE,
  DEACTIVATE, MOVETOHOME, MOVETOHOMESINGLE, MOVETOLIMIT,
  MOVETOPOSITIVELIMIT, MOVETONEGATIVELIMIT, STOP, ABORT,
  OPEN, CLOSE, RESET, INIT,
  DEINIT, ACTIVATE, DEACTIVATE, MOVETOHOME,
  MOVETOHOMESINGLE, MOVETOLIMIT, MOVETOPOSITIVELIMIT, MOVETONEGATIVELIMIT,
  STOP, ABORT
}
 
enum  CMDS {
  OPEN, CLOSE, RESET, INIT,
  DEINIT, ACTIVATE, DEACTIVATE, MOVETOHOME,
  MOVETOHOMESINGLE, MOVETOLIMIT, MOVETOPOSITIVELIMIT, MOVETONEGATIVELIMIT,
  STOP, ABORT, OPEN, CLOSE,
  RESET, INIT, DEINIT, ACTIVATE,
  DEACTIVATE, MOVETOHOME, MOVETOHOMESINGLE, MOVETOLIMIT,
  MOVETOPOSITIVELIMIT, MOVETONEGATIVELIMIT, STOP, ABORT,
  OPEN, CLOSE, RESET, INIT,
  DEINIT, ACTIVATE, DEACTIVATE, MOVETOHOME,
  MOVETOHOMESINGLE, MOVETOLIMIT, MOVETOPOSITIVELIMIT, MOVETONEGATIVELIMIT,
  STOP, ABORT
}
 
enum  CMDS {
  OPEN, CLOSE, RESET, INIT,
  DEINIT, ACTIVATE, DEACTIVATE, MOVETOHOME,
  MOVETOHOMESINGLE, MOVETOLIMIT, MOVETOPOSITIVELIMIT, MOVETONEGATIVELIMIT,
  STOP, ABORT, OPEN, CLOSE,
  RESET, INIT, DEINIT, ACTIVATE,
  DEACTIVATE, MOVETOHOME, MOVETOHOMESINGLE, MOVETOLIMIT,
  MOVETOPOSITIVELIMIT, MOVETONEGATIVELIMIT, STOP, ABORT,
  OPEN, CLOSE, RESET, INIT,
  DEINIT, ACTIVATE, DEACTIVATE, MOVETOHOME,
  MOVETOHOMESINGLE, MOVETOLIMIT, MOVETOPOSITIVELIMIT, MOVETONEGATIVELIMIT,
  STOP, ABORT
}
 
- Protected Attributes inherited from Basda::MoccaDevice
Nice::Completion m_completion
 
- Protected Attributes inherited from Basda::Device
Nice::JointPtr m_config
 
Nice::JointPtr m_cfg
 
Nice::JointPtr m_var
 
std::string m_name
 

Detailed Description

This is the MoCon device, which support to control N motors.

This class auto-generates a motor controller device interface for the MPIA in-house motor controller based on the user defined configuration file. The constructor goes through the property tree and connects to each defined module.

The name of a motor can be individually defined in the configuration file. The motor configuration will be stored in the property tree under the motor name. Thereby the motors in the property tree are sorted in alphabetical order. The same order is valid for the values in the vectors of the method parameter. For example the first absolute position in the vector of the method moveAbs belong to the motor A, the second value belong to the motor B, and so on.

The motor itself can be connected to any motor controller. That makes the command interface independent from the hardware configuration.

The electronic design of the motor controller distinguish between a motor controller card, that provides general commands (like network settings or commands to control multiple motors) and a motor controller module, that provides motor specific commands (like move commands). This class combine the motor controller module and the motor controller card to one device. It can control complex commands, which need a setup procedure first before it can be executed and it can handle event or error messages. It is the basement for all other application that have to operate with the motor controller.

Author
Frank Kittmann
Version
09.06.23
Date
2009.06.23

Constructor & Destructor Documentation

◆ MoConNDevice() [1/2]

Basda::MoConNDevice::MoConNDevice ( const Nice::JointPtr _config)

Constructor.

The constructor gets the root node of the device as parameter like SVC.DEV.THE_DEVICE and creates a user defined motor controller device. Thereby a motor object is generated for each founded module in the property tree. The generated motor object reserves the motor to avoid a multible access from other clients. The corresponding card object will also be generated and stored in a list.

Parameters
_configthe root node of the device which contain all modules
See also
Basda::MoConCard
Basda::MoConModule

◆ ~MoConNDevice() [1/2]

Basda::MoConNDevice::~MoConNDevice ( )

Destructor.

removes all created bridges

◆ MoConNDevice() [2/2]

Basda::MoConNDevice::MoConNDevice ( const Nice::JointPtr _config)

Constructor.

The constructor gets the root node of the device as parameter like SVC.DEV.THE_DEVICE and creates a user defined motor controller device. Thereby a motor object is generated for each founded module in the property tree. The generated motor object reserves the motor to avoid a multible access from other clients. The corresponding card object will also be generated and stored in a list.

Parameters
_configthe root node of the device which contain all modules
See also
Basda::MoConCard
Basda::MoConModule

◆ ~MoConNDevice() [2/2]

Basda::MoConNDevice::~MoConNDevice ( )

Destructor.

removes all created bridges

Member Function Documentation

◆ abort() [1/2]

void Basda::MoConNDevice::abort ( void  )
virtual

Abort the moving of the motor immediately without deceleration.

Note
Abrupt stop of a fast running motor can leads to losing steps. The motor could be damaged too.

Implements Basda::MoccaDevice.

◆ abort() [2/2]

virtual void Basda::MoConNDevice::abort ( )
virtual

Abort the moving of the motor immediately without deceleration.

Note
Abrupt stop of a fast running motor can leads to losing steps. The motor could be damaged too.

Implements Basda::MoccaDevice.

◆ activate() [1/2]

void Basda::MoConNDevice::activate ( Basda::DeviceAsync _async = Basda::Device::s_async)
virtual

activate something

Parameters
_asynchthe call back object
Todo:
implementation of the service activation

Implements Basda::Device.

◆ activate() [2/2]

virtual void Basda::MoConNDevice::activate ( DeviceAsync = Basda::Device::s_async)
virtual

activate something

Parameters
_asynchthe call back object
Todo:
implementation of the service activation

Implements Basda::Device.

◆ addProperties() [1/2]

void Basda::MoConNDevice::addProperties ( )
private

This method add the following internal status properties.

  • VAR.POSITION +UNIT
  • VAR.VELOCITY +UNIT
  • VAR.HOME_KNOWN +LABEL
  • VAR.MOVING
  • VAR.ON_POSITIVE_LIMIT
  • VAR.ON_NEGATIVE_LIMIT
  • VAR.TRACE.INFO.TRACING
  • VAR.TRACE.INFO.TRACED_VALUES
  • VAR.UNIT +SELECT

◆ addProperties() [2/2]

void Basda::MoConNDevice::addProperties ( )
private

This method add the following internal status properties.

  • VAR.POSITION +UNIT
  • VAR.VELOCITY +UNIT
  • VAR.HOME_KNOWN +LABEL
  • VAR.MOVING
  • VAR.ON_POSITIVE_LIMIT
  • VAR.ON_NEGATIVE_LIMIT
  • VAR.TRACE.INFO.TRACING
  • VAR.TRACE.INFO.TRACED_VALUES
  • VAR.UNIT +SELECT

◆ changeExternalProfile() [1/2]

virtual void Basda::MoConNDevice::changeExternalProfile ( const Nice::Date _date,
const Nice::NPoint _positionSequence 
)
virtual

This method fit, validates and buffers the external profile.

Parameters
_datethe start date of the external profile
_positionSequencethe position sequence in steps

Implements Basda::MoccaNDevice.

◆ changeExternalProfile() [2/2]

void Basda::MoConNDevice::changeExternalProfile ( const Nice::Date _date,
const Nice::NPoint _positionSequence 
)
virtual

This method fit, validates and buffers the external profile.

Parameters
_datethe start date of the external profile
_positionSequencethe position sequence in steps

Implements Basda::MoccaNDevice.

◆ chat() [1/2]

void Basda::MoConNDevice::chat ( std::string  _cardNo,
std::string  _commandID,
std::string  _moduleNo,
std::string  _selectID,
std::string  _parameter,
std::string  _numberOfLines,
Basda::DeviceAsync _async = Basda::Device::s_async 
)
virtual

This method send the command string to the electronic.

This method is set to public due to requests from Lorenzo Busoni. BUT THE USER OF THIS METHOD TAKE OVER THE RESPONSIBILITY OF THE CORRECT ERROR HANDLING. THE DRIVER DOES NOT HAVE THE CONTROL OVER THAT DEVICE ANY MORE.

Parameters
_commandIDthe command ID
_selectIDthe sub command ID
_cardNothe ID of the MPIA electronic card
_moduleNothe ID of the device module
_parameterthe parameter as string
_numberOfLinesthe number of lines that might be read

Hi Martin,

that's exactly what I was thinking: The use case is (real example from our experience): we discover at the telescope that we need to continuously monitor a given property (PropA) of the MoCon (obviously because of a malfunctioning in the hardware!). Without this monitor, we will be stuck. You can add the required functionality in the Mocca adding the function getPropA: this requires 4 hours and the day is lost. The day after you are stuck because you discover that you miss PropB, and the day is lost again. As an alternative, one can add the 2 lines below in the code (with a comment: "1 10 0 = getPropA") and this requires 5 minutes. The day after one can add a similar line with 1 11 0. When you're back in Europe you implement getPropA and getPropB in Mocca and you cleanup the code removing the receiveResponseForComment

Generally speaking I think it is a safe idea to have a generic interface to access EVERY possible functionality of a device, because soon or later you'll need it. In the case of the Mocon it is quite easy, a good compromise between living dangerously and wasting too much time in the effort of a complete implementation of all the MoCon commands.

Lorenzo Busoni

Implements Basda::MoccaNDevice.

◆ chat() [2/2]

virtual void Basda::MoConNDevice::chat ( std::string  _cardNo,
std::string  _commandID,
std::string  _moduleNo,
std::string  _selectID,
std::string  _parameter,
std::string  _numberOfLines,
Basda::DeviceAsync = Basda::Device::s_async 
)
virtual

This method send the command string to the electronic.

This method is set to public due to requests from Lorenzo Busoni. BUT THE USER OF THIS METHOD TAKE OVER THE RESPONSIBILITY OF THE CORRECT ERROR HANDLING. THE DRIVER DOES NOT HAVE THE CONTROL OVER THAT DEVICE ANY MORE.

Parameters
_commandIDthe command ID
_selectIDthe sub command ID
_cardNothe ID of the MPIA electronic card
_moduleNothe ID of the device module
_parameterthe parameter as string
_numberOfLinesthe number of lines that might be read

Hi Martin,

that's exactly what I was thinking: The use case is (real example from our experience): we discover at the telescope that we need to continuously monitor a given property (PropA) of the MoCon (obviously because of a malfunctioning in the hardware!). Without this monitor, we will be stuck. You can add the required functionality in the Mocca adding the function getPropA: this requires 4 hours and the day is lost. The day after you are stuck because you discover that you miss PropB, and the day is lost again. As an alternative, one can add the 2 lines below in the code (with a comment: "1 10 0 = getPropA") and this requires 5 minutes. The day after one can add a similar line with 1 11 0. When you're back in Europe you implement getPropA and getPropB in Mocca and you cleanup the code removing the receiveResponseForComment

Generally speaking I think it is a safe idea to have a generic interface to access EVERY possible functionality of a device, because soon or later you'll need it. In the case of the Mocon it is quite easy, a good compromise between living dangerously and wasting too much time in the effort of a complete implementation of all the MoCon commands.

Lorenzo Busoni

Implements Basda::MoccaNDevice.

◆ close() [1/2]

void Basda::MoConNDevice::close ( void  )
virtual

This method might be called when the service goes in the OFFLINE state.

The connection to the modules will be closed.

Todo:
implementation of the OFFLINE state

Implements Basda::Device.

◆ close() [2/2]

virtual void Basda::MoConNDevice::close ( )
virtual

This method might be called when the service goes in the OFFLINE state.

The connection to the modules will be closed.

Todo:
implementation of the OFFLINE state

Implements Basda::Device.

◆ completion() [1/2]

void Basda::MoConNDevice::completion ( std::string  _cmd,
Basda::DeviceAsync _async = Basda::Device::s_async 
)
private

Calculate the completion percent.

Parameters
_cmdthe command name which appears in the completion bar
_asynchthe call back object

◆ completion() [2/2]

void Basda::MoConNDevice::completion ( std::string  _cmd,
Basda::DeviceAsync = Basda::Device::s_async 
)
private

Calculate the completion percent.

Parameters
_cmdthe command name which appears in the completion bar
_asynchthe call back object

◆ createConnectionID() [1/2]

std::string Basda::MoConNDevice::createConnectionID ( const std::string &  _address,
const unsigned int  _cardNo,
const unsigned int  _moduleNo 
)

This method creates an ID based on the connection address, card number and module number separated by a colon to identify the module/card object in a map.

Parameters
_addressthe connection string
_cardNothe card number
_moduleNothe module number

◆ createConnectionID() [2/2]

std::string Basda::MoConNDevice::createConnectionID ( const std::string &  _address,
const unsigned int  _cardNo,
const unsigned int  _moduleNo 
)

This method creates an ID based on the connection address, card number and module number separated by a colon to identify the module/card object in a map.

Parameters
_addressthe connection string
_cardNothe card number
_moduleNothe module number

◆ createInstances() [1/2]

void Basda::MoConNDevice::createInstances ( )
private

◆ createInstances() [2/2]

void Basda::MoConNDevice::createInstances ( )
private

◆ deactivate() [1/2]

void Basda::MoConNDevice::deactivate ( Basda::DeviceAsync _async = Basda::Device::s_async)
virtual

deactivate something

Parameters
_asynchthe call back object
Todo:
implementation of the service deactivation

Implements Basda::Device.

◆ deactivate() [2/2]

virtual void Basda::MoConNDevice::deactivate ( DeviceAsync = Basda::Device::s_async)
virtual

deactivate something

Parameters
_asynchthe call back object
Todo:
implementation of the service deactivation

Implements Basda::Device.

◆ deinit() [1/2]

virtual void Basda::MoConNDevice::deinit ( DeviceAsync = Basda::Device::s_async)
virtual

This method deinitialize the device and set the state to OFFLINE.

Parameters
_asynchthe call back object
Todo:
implementation of the OFFLINE state

Implements Basda::Device.

◆ deinit() [2/2]

void Basda::MoConNDevice::deinit ( Basda::DeviceAsync _async = Basda::Device::s_async)
virtual

This method deinitialize the device and set the state to OFFLINE.

Parameters
_asynchthe call back object
Todo:
implementation of the OFFLINE state

Implements Basda::Device.

◆ description() [1/2]

virtual Nice::JointPtrVector Basda::MoConNDevice::description ( void  )
inlinevirtual

◆ description() [2/2]

virtual Nice::JointPtrVector Basda::MoConNDevice::description ( void  )
inlinevirtual

◆ dontParse() [1/2]

std::string Basda::MoConNDevice::dontParse ( Basda::DeviceAsync _async = Basda::Device::s_async)
virtual

This method was requested by Lorenzo Busoni (lbuso.nosp@m.ni@a.nosp@m.rcetr.nosp@m.i.as.nosp@m.tro.i.nosp@m.t 02.03.2012)

It supports a direct communication with the MoCon. BUT THE USER OF THIS METHOD TAKE OVER THE RESPONSIBILITY OF THE CORRECT ERROR HANDLING. THE DRIVER DOES NOT HAVE THE CONTROL OVER THAT DEVICE ANY MORE.

Parameters
_retthe allocated memory for the command response
See also
chat

Implements Basda::MoccaNDevice.

◆ dontParse() [2/2]

virtual std::string Basda::MoConNDevice::dontParse ( Basda::DeviceAsync = Basda::Device::s_async)
virtual

This method was requested by Lorenzo Busoni (lbuso.nosp@m.ni@a.nosp@m.rcetr.nosp@m.i.as.nosp@m.tro.i.nosp@m.t 02.03.2012)

It supports a direct communication with the MoCon. BUT THE USER OF THIS METHOD TAKE OVER THE RESPONSIBILITY OF THE CORRECT ERROR HANDLING. THE DRIVER DOES NOT HAVE THE CONTROL OVER THAT DEVICE ANY MORE.

Parameters
_retthe allocated memory for the command response
See also
chat

Implements Basda::MoccaNDevice.

◆ dumpStatusInformation() [1/2]

void Basda::MoConNDevice::dumpStatusInformation ( Basda::DeviceAsync _async = Basda::Device::s_async,
bool  _compareParameter = false 
)
virtual

This method downloads all configuration parameter of the MoCon.

Implements Basda::MoccaNDevice.

◆ dumpStatusInformation() [2/2]

void Basda::MoConNDevice::dumpStatusInformation ( Basda::DeviceAsync = Basda::Device::s_async,
bool  _compareParameter = false 
)
virtual

This method downloads all configuration parameter of the MoCon.

Implements Basda::MoccaNDevice.

◆ generateExternalProfile() [1/2]

void Basda::MoConNDevice::generateExternalProfile ( const Nice::Date _date,
const Nice::NPoint _positionSequence 
)
private

This method fit, validates and buffers the external profile.

Parameters
_date- the start date when the trajectory should start
_positionSequence- the position sequence in steps

◆ generateExternalProfile() [2/2]

void Basda::MoConNDevice::generateExternalProfile ( const Nice::Date _date,
const Nice::NPoint _positionSequence 
)
private

This method fit, validates and buffers the external profile.

Parameters
_date- the start date when the trajectory should start
_positionSequence- the position sequence in steps

◆ getAbsoluteEncoderPosition() [1/2]

Nice::NPoint Basda::MoConNDevice::getAbsoluteEncoderPosition ( )
virtual

Returns the current positions of all motors.

The current position of all motors will be stored in the property

  • VAR.POSITION.ABSOLUTE_ENCODER

Implements Basda::MoccaNDevice.

◆ getAbsoluteEncoderPosition() [2/2]

virtual Nice::NPoint Basda::MoConNDevice::getAbsoluteEncoderPosition ( )
virtual

Returns the current positions of all motors.

The current position of all motors will be stored in the property

  • VAR.POSITION.ABSOLUTE_ENCODER

Implements Basda::MoccaNDevice.

◆ getBasicSettings() [1/2]

Nice::SeqSeqDouble Basda::MoConNDevice::getBasicSettings ( )
virtual

This method returns the basic settings of all MoCon module.

Returns
A sequence of the basic settings with the following parameter order: profile, revolution, velocity straight, velocity start, acceleration, deceleration, jerk

Implements Basda::MoccaNDevice.

◆ getBasicSettings() [2/2]

virtual Nice::SeqSeqDouble Basda::MoConNDevice::getBasicSettings ( )
virtual

This method returns the basic settings of all MoCon module.

Returns
A sequence of the basic settings with the following parameter order: profile, revolution, velocity straight, velocity start, acceleration, deceleration, jerk

Implements Basda::MoccaNDevice.

◆ getCurrentTime() [1/2]

virtual Nice::NPoint Basda::MoConNDevice::getCurrentTime ( )
virtual

This method returns the current MoCon time.

For each motor, that name is stored in the vector, the current MoCon cycles and the PC time will be stored.

See also
getReferenceTime()
Basda::MoConModule::getCurrentTime()

Implements Basda::MoccaNDevice.

◆ getCurrentTime() [2/2]

Nice::NPoint Basda::MoConNDevice::getCurrentTime ( )
virtual

This method returns the current MoCon time.

For each motor, that name is stored in the vector, the current MoCon cycles and the PC time will be stored.

See also
getReferenceTime()
Basda::MoConModule::getCurrentTime()

Implements Basda::MoccaNDevice.

◆ getDeviceEncoderPosition() [1/2]

Nice::NPoint Basda::MoConNDevice::getDeviceEncoderPosition ( )
virtual

Returns the current positions of all motors.

The current position of all motors will be stored in the property

  • VAR.POSITION.DEVICE_ENCODER

Implements Basda::MoccaNDevice.

◆ getDeviceEncoderPosition() [2/2]

virtual Nice::NPoint Basda::MoConNDevice::getDeviceEncoderPosition ( )
virtual

Returns the current positions of all motors.

The current position of all motors will be stored in the property

  • VAR.POSITION.DEVICE_ENCODER

Implements Basda::MoccaNDevice.

◆ getIncrementalEncoderPosition() [1/2]

Nice::NPoint Basda::MoConNDevice::getIncrementalEncoderPosition ( )
virtual

Returns the current positions of all motors.

The current position of all motors will be stored in the property

  • VAR.POSITION.INCREMENTAL_ENCODER

Implements Basda::MoccaNDevice.

◆ getIncrementalEncoderPosition() [2/2]

virtual Nice::NPoint Basda::MoConNDevice::getIncrementalEncoderPosition ( )
virtual

Returns the current positions of all motors.

The current position of all motors will be stored in the property

  • VAR.POSITION.INCREMENTAL_ENCODER

Implements Basda::MoccaNDevice.

◆ getLinkTimeout() [1/2]

virtual Nice::SeqTime Basda::MoConNDevice::getLinkTimeout ( )
virtual

This method returns TCP connection timeout.

For each motor, that name is stored in the vector, the TCP connection timeout will be stored.

Returns
the TCP connection timeout

Implements Basda::MoccaNDevice.

◆ getLinkTimeout() [2/2]

Nice::SeqTime Basda::MoConNDevice::getLinkTimeout ( )
virtual

This method returns TCP connection timeout.

For each motor, that name is stored in the vector, the TCP connection timeout will be stored.

Returns
the TCP connection timeout

Implements Basda::MoccaNDevice.

◆ getPosition() [1/2]

Nice::NPoint Basda::MoConNDevice::getPosition ( )
virtual

This method is deprecated and will be exchanged with getDeviceencoderPosition()

Implements Basda::MoccaNDevice.

◆ getPosition() [2/2]

virtual Nice::NPoint Basda::MoConNDevice::getPosition ( )
virtual

This method is deprecated and will be exchanged with getDeviceencoderPosition()

Implements Basda::MoccaNDevice.

◆ getPositionSwitchStatus() [1/2]

virtual Nice::SeqBitSet Basda::MoConNDevice::getPositionSwitchStatus ( )
virtual

Returns the status of the position switch.

Returns
a sequence of BitSets.

Implements Basda::MoccaNDevice.

◆ getPositionSwitchStatus() [2/2]

Nice::SeqBitSet Basda::MoConNDevice::getPositionSwitchStatus ( )
virtual

Returns the status of the position switch.

Returns
a sequence of BitSets.

Implements Basda::MoccaNDevice.

◆ getProgress() [1/2]

Nice::Completion Basda::MoConNDevice::getProgress ( )
virtual

Implements Basda::MoccaDevice.

◆ getProgress() [2/2]

virtual Nice::Completion Basda::MoConNDevice::getProgress ( )
virtual

Implements Basda::MoccaDevice.

◆ getReferenceTime() [1/2]

virtual Nice::NPoint Basda::MoConNDevice::getReferenceTime ( )
virtual

This method synchronize the MoCon time with the PC time.

For each motor, that name is stored in the vector, the current MoCon cycles and the PC time will be stored.

See also
getCurrentTime()
Basda::MoConModule::synchronizeTime()

Implements Basda::MoccaNDevice.

◆ getReferenceTime() [2/2]

Nice::NPoint Basda::MoConNDevice::getReferenceTime ( )
virtual

This method synchronize the MoCon time with the PC time.

For each motor, that name is stored in the vector, the current MoCon cycles and the PC time will be stored.

See also
getCurrentTime()
Basda::MoConModule::synchronizeTime()

Implements Basda::MoccaNDevice.

◆ getVelocity() [1/2]

Nice::NPoint Basda::MoConNDevice::getVelocity ( )
virtual

Returns the current velocity of all motors.

The current velocity of all motors will be stored in the property

  • VAR.VELOCITY

Implements Basda::MoccaNDevice.

◆ getVelocity() [2/2]

virtual Nice::NPoint Basda::MoConNDevice::getVelocity ( )
virtual

Returns the current velocity of all motors.

The current velocity of all motors will be stored in the property

  • VAR.VELOCITY

Implements Basda::MoccaNDevice.

◆ init() [1/2]

virtual void Basda::MoConNDevice::init ( DeviceAsync = Basda::Device::s_async)
virtual

This method initialize the device and set the state to INIT.

Parameters
_asynchthe call back object
Todo:
implementation of the INIT state

Implements Basda::Device.

◆ init() [2/2]

void Basda::MoConNDevice::init ( Basda::DeviceAsync _async = Basda::Device::s_async)
virtual

This method initialize the device and set the state to INIT.

Parameters
_asynchthe call back object
Todo:
implementation of the INIT state

Implements Basda::Device.

◆ isAtHome() [1/2]

virtual bool Basda::MoConNDevice::isAtHome ( Nice::BitSet _atHome)
virtual

This method indicate whether the motor is at the home position.

Parameters
_atHomeeach flag in that Bitset indicate whether the motor is at home (true - motor is at home;). The order of the bits is corresponding to the order of the motor names in the property tree (alphabetical).

Implements Basda::MoccaNDevice.

◆ isAtHome() [2/2]

bool Basda::MoConNDevice::isAtHome ( Nice::BitSet _atHome)
virtual

This method indicate whether the motor is at the home position.

Parameters
_atHomeeach flag in that Bitset indicate whether the motor is at home (true - motor is at home;). The order of the bits is corresponding to the order of the motor names in the property tree (alphabetical).

Implements Basda::MoccaNDevice.

◆ isAtLimit() [1/2]

virtual bool Basda::MoConNDevice::isAtLimit ( Nice::NPoint _limit)
virtual

Checks if one of the motors is in limit.

This method collects the limit flags of all motors and stores it in the property:

  • VAR.LIMIT
Parameters
_limit- return a vector with all motor limit switch flags (0 - not in limit; +/-1 in software limit; +/-2 in hardware limit)
Returns
is true when the device is in the limit, false otherwise

Implements Basda::MoccaNDevice.

◆ isAtLimit() [2/2]

bool Basda::MoConNDevice::isAtLimit ( Nice::NPoint _limit)
virtual

Checks if one of the motors is in limit.

This method collects the limit flags of all motors and stores it in the property:

  • VAR.LIMIT
Parameters
_limit- return a vector with all motor limit switch flags (0 - not in limit; +/-1 in software limit; +/-2 in hardware limit)
Returns
is true when the device is in the limit, false otherwise

Implements Basda::MoccaNDevice.

◆ isMotionComplete() [1/2]

bool Basda::MoConNDevice::isMotionComplete ( Nice::BitSet _motion)
private

Checks if the motion is complete.

This method collect the MOTION_COMPLETE flags of all motors.

The following property will indicate the motion completeness

  • VAR.MOTION_COMPLETE
Parameters
_motionreturns which motor is in motion
Returns
true if all motor have completed its motion

◆ isMotionComplete() [2/2]

bool Basda::MoConNDevice::isMotionComplete ( Nice::BitSet _motion)
private

Checks if the motion is complete.

This method collect the MOTION_COMPLETE flags of all motors.

The following property will indicate the motion completeness

  • VAR.MOTION_COMPLETE
Parameters
_motionreturns which motor is in motion
Returns
true if all motor have completed its motion

◆ isMoving() [1/2]

virtual bool Basda::MoConNDevice::isMoving ( Nice::BitSet _motion)
virtual

Checks if one of the motors is in motion.

The method collects the motion flag of every motor and stores it in the property

  • VAR.MOVING
Parameters
_motionreturns which motor is in motion
Returns
true if at least one motor is in motion

Implements Basda::MoccaNDevice.

◆ isMoving() [2/2]

bool Basda::MoConNDevice::isMoving ( Nice::BitSet _motion)
virtual

Checks if one of the motors is in motion.

The method collects the motion flag of every motor and stores it in the property

  • VAR.MOVING
Parameters
_motionreturns which motor is in motion
Returns
true if at least one motor is in motion

Implements Basda::MoccaNDevice.

◆ isReachable() [1/2]

bool Basda::MoConNDevice::isReachable ( )
virtual

Returns if the device is reachable.

Returns
the status of the device.

Implements Basda::MoccaNDevice.

◆ isReachable() [2/2]

virtual bool Basda::MoConNDevice::isReachable ( )
virtual

Returns if the device is reachable.

Returns
the status of the device.

Implements Basda::MoccaNDevice.

◆ moveAbsolute() [1/2]

virtual void Basda::MoConNDevice::moveAbsolute ( const Nice::NPoint _positions,
Basda::DeviceAsync _async = Basda::Device::s_async 
)
inlinevirtual

The motors that are stored in the vector, move to the absolute position.

Parameters
_positionsare the target positions of type Nice::NPoint whereas the order of the points is corresponding to the order of the motor names in the property tree (alphabetical).
_asynchthe call back object

Implements Basda::MoccaNDevice.

◆ moveAbsolute() [2/2]

virtual void Basda::MoConNDevice::moveAbsolute ( const Nice::NPoint _positions,
Basda::DeviceAsync _async = Basda::Device::s_async 
)
inlinevirtual

The motors that are stored in the vector, move to the absolute position.

Parameters
_positionsare the target positions of type Nice::NPoint whereas the order of the points is corresponding to the order of the motor names in the property tree (alphabetical).
_asynchthe call back object

Implements Basda::MoccaNDevice.

◆ moveAbsoluteStart() [1/2]

virtual void Basda::MoConNDevice::moveAbsoluteStart ( const Nice::NPoint _positions,
Basda::DeviceAsync = Basda::Device::s_async 
)
virtual

Implements Basda::MoccaNDevice.

◆ moveAbsoluteStart() [2/2]

void Basda::MoConNDevice::moveAbsoluteStart ( const Nice::NPoint _positions,
Basda::DeviceAsync _async = Basda::Device::s_async 
)
virtual

Implements Basda::MoccaNDevice.

◆ moveAbsoluteWait() [1/2]

virtual void Basda::MoConNDevice::moveAbsoluteWait ( Basda::DeviceAsync = Basda::Device::s_async)
virtual

Implements Basda::MoccaNDevice.

◆ moveAbsoluteWait() [2/2]

void Basda::MoConNDevice::moveAbsoluteWait ( Basda::DeviceAsync _async = Basda::Device::s_async)
virtual

Implements Basda::MoccaNDevice.

◆ moveOutOfLimit() [1/2]

virtual void Basda::MoConNDevice::moveOutOfLimit ( int  _motor,
Basda::DeviceAsync _async 
)
virtual

move all motors out of the limit switches.

Due to a bug in the MoCon chipset it is required to move all motors out of the limit before move to home. The MoCon will crash otherwise!

No asynchronous command is available because the moveToHome method needs this synchronous method to be sure that all motors are out of the limit after that call.

Parameters
_motorthe motor ID. The order of motors is the same as in the property tree (alphabetical). If the motor ID is -1, all motors will move out of the limit
_asynchthe call back object

◆ moveOutOfLimit() [2/2]

void Basda::MoConNDevice::moveOutOfLimit ( int  _motor,
Basda::DeviceAsync _async 
)
virtual

move all motors out of the limit switches.

Due to a bug in the MoCon chipset it is required to move all motors out of the limit before move to home. The MoCon will crash otherwise!

No asynchronous command is available because the moveToHome method needs this synchronous method to be sure that all motors are out of the limit after that call.

Parameters
_motorthe motor ID. The order of motors is the same as in the property tree (alphabetical). If the motor ID is -1, all motors will move out of the limit
_asynchthe call back object

◆ moveRelative() [1/2]

virtual void Basda::MoConNDevice::moveRelative ( const Nice::NPoint _positions,
Basda::DeviceAsync _async = Basda::Device::s_async 
)
inlinevirtual

The motors that are stored in the vector move to the relative position.

Parameters
_positionsare the target positions of type Nice::NPoint whereas the order of the points is corresponding to the order of the motor names in the property tree (alphabetical).
_asynchthe call back object

Implements Basda::MoccaNDevice.

◆ moveRelative() [2/2]

virtual void Basda::MoConNDevice::moveRelative ( const Nice::NPoint _positions,
Basda::DeviceAsync _async = Basda::Device::s_async 
)
inlinevirtual

The motors that are stored in the vector move to the relative position.

Parameters
_positionsare the target positions of type Nice::NPoint whereas the order of the points is corresponding to the order of the motor names in the property tree (alphabetical).
_asynchthe call back object

Implements Basda::MoccaNDevice.

◆ moveRelativeStart() [1/2]

void Basda::MoConNDevice::moveRelativeStart ( const Nice::NPoint _positions,
Basda::DeviceAsync _async = Basda::Device::s_async 
)
virtual

Implements Basda::MoccaNDevice.

◆ moveRelativeStart() [2/2]

virtual void Basda::MoConNDevice::moveRelativeStart ( const Nice::NPoint _positions,
Basda::DeviceAsync = Basda::Device::s_async 
)
virtual

Implements Basda::MoccaNDevice.

◆ moveRelativeWait() [1/2]

void Basda::MoConNDevice::moveRelativeWait ( Basda::DeviceAsync _async = Basda::Device::s_async)
virtual

Implements Basda::MoccaNDevice.

◆ moveRelativeWait() [2/2]

virtual void Basda::MoConNDevice::moveRelativeWait ( Basda::DeviceAsync = Basda::Device::s_async)
virtual

Implements Basda::MoccaNDevice.

◆ moveToHome() [1/2]

virtual void Basda::MoConNDevice::moveToHome ( Basda::DeviceAsync _aync = Basda::Device::s_async)
inlinevirtual

All motors of the device are looking for the reference positions and reset the step counter to zero.

Parameters
_asynchthe call back object

Implements Basda::MoccaDevice.

◆ moveToHome() [2/2]

virtual void Basda::MoConNDevice::moveToHome ( Basda::DeviceAsync _aync = Basda::Device::s_async)
inlinevirtual

All motors of the device are looking for the reference positions and reset the step counter to zero.

Parameters
_asynchthe call back object

Implements Basda::MoccaDevice.

◆ moveToHomeSingle() [1/2]

virtual void Basda::MoConNDevice::moveToHomeSingle ( int  _motor,
Basda::DeviceAsync _async = Basda::Device::s_async 
)
inlinevirtual

A single motor of the device is looking for the reference positions and reset the step counter to zero.

Parameters
_asynchthe call back object

Implements Basda::MoccaDevice.

◆ moveToHomeSingle() [2/2]

virtual void Basda::MoConNDevice::moveToHomeSingle ( int  _motor,
Basda::DeviceAsync _async = Basda::Device::s_async 
)
inlinevirtual

A single motor of the device is looking for the reference positions and reset the step counter to zero.

Parameters
_asynchthe call back object

Implements Basda::MoccaDevice.

◆ moveToHomeSingleStart() [1/2]

void Basda::MoConNDevice::moveToHomeSingleStart ( int  _motor,
Basda::DeviceAsync _async = Basda::Device::s_async 
)
virtual

Implements Basda::MoccaDevice.

◆ moveToHomeSingleStart() [2/2]

virtual void Basda::MoConNDevice::moveToHomeSingleStart ( int  _motor,
Basda::DeviceAsync = Basda::Device::s_async 
)
virtual

Implements Basda::MoccaDevice.

◆ moveToHomeSingleWait() [1/2]

virtual void Basda::MoConNDevice::moveToHomeSingleWait ( Basda::DeviceAsync = Basda::Device::s_async)
virtual

Implements Basda::MoccaDevice.

◆ moveToHomeSingleWait() [2/2]

void Basda::MoConNDevice::moveToHomeSingleWait ( Basda::DeviceAsync _async = Basda::Device::s_async)
virtual

Implements Basda::MoccaDevice.

◆ moveToHomeStart() [1/2]

virtual void Basda::MoConNDevice::moveToHomeStart ( Basda::DeviceAsync = Basda::Device::s_async)
virtual

Implements Basda::MoccaDevice.

◆ moveToHomeStart() [2/2]

void Basda::MoConNDevice::moveToHomeStart ( Basda::DeviceAsync _async = Basda::Device::s_async)
virtual

Implements Basda::MoccaDevice.

◆ moveToHomeWait() [1/2]

virtual void Basda::MoConNDevice::moveToHomeWait ( Basda::DeviceAsync = Basda::Device::s_async)
virtual

Implements Basda::MoccaDevice.

◆ moveToHomeWait() [2/2]

void Basda::MoConNDevice::moveToHomeWait ( Basda::DeviceAsync _async = Basda::Device::s_async)
virtual

Implements Basda::MoccaDevice.

◆ moveToLimit() [1/2]

virtual void Basda::MoConNDevice::moveToLimit ( const Nice::NPoint _limit,
Basda::DeviceAsync _async = Basda::Device::s_async 
)
inlinevirtual

move all motors to the positive limit switches (_limits[i]>0) or negative (_limits[i]<0) limit switches.

Parameters
_limita vector that contains to which limit the motors have to move (_limits[i]= 1 - to positive software limit) (_limits[i]=-1 - to negative software limit) (_limits[i]= 2 - to positive hardware limit) - needed to initialize the SE (_limits[i]=-2 - to negative hardware limit) - needed to initialize the SE whereas the order of the points is corresponding to the order of the motor names in the property tree (alphabetical).
_asynchthe call back object

Implements Basda::MoccaDevice.

◆ moveToLimit() [2/2]

virtual void Basda::MoConNDevice::moveToLimit ( const Nice::NPoint _limit,
Basda::DeviceAsync _async = Basda::Device::s_async 
)
inlinevirtual

move all motors to the positive limit switches (_limits[i]>0) or negative (_limits[i]<0) limit switches.

Parameters
_limita vector that contains to which limit the motors have to move (_limits[i]= 1 - to positive software limit) (_limits[i]=-1 - to negative software limit) (_limits[i]= 2 - to positive hardware limit) - needed to initialize the SE (_limits[i]=-2 - to negative hardware limit) - needed to initialize the SE whereas the order of the points is corresponding to the order of the motor names in the property tree (alphabetical).
_asynchthe call back object

Implements Basda::MoccaDevice.

◆ moveToLimitStart() [1/2]

virtual void Basda::MoConNDevice::moveToLimitStart ( const Nice::NPoint _limit,
Basda::DeviceAsync = Basda::Device::s_async 
)
virtual

Implements Basda::MoccaDevice.

◆ moveToLimitStart() [2/2]

void Basda::MoConNDevice::moveToLimitStart ( const Nice::NPoint _limit,
Basda::DeviceAsync _async = Basda::Device::s_async 
)
virtual

Implements Basda::MoccaDevice.

◆ moveToLimitWait() [1/2]

void Basda::MoConNDevice::moveToLimitWait ( Basda::DeviceAsync _async = Basda::Device::s_async)
virtual

Implements Basda::MoccaDevice.

◆ moveToLimitWait() [2/2]

virtual void Basda::MoConNDevice::moveToLimitWait ( Basda::DeviceAsync = Basda::Device::s_async)
virtual

Implements Basda::MoccaDevice.

◆ moveToNegativeLimit() [1/2]

virtual void Basda::MoConNDevice::moveToNegativeLimit ( Basda::DeviceAsync _async = Basda::Device::s_async)
inlinevirtual

All motors of the device move to the negative software limit switch.

Parameters
_asynchthe call back object

Implements Basda::MoccaDevice.

◆ moveToNegativeLimit() [2/2]

virtual void Basda::MoConNDevice::moveToNegativeLimit ( Basda::DeviceAsync _async = Basda::Device::s_async)
inlinevirtual

All motors of the device move to the negative software limit switch.

Parameters
_asynchthe call back object

Implements Basda::MoccaDevice.

◆ moveToNegativeLimitStart() [1/2]

void Basda::MoConNDevice::moveToNegativeLimitStart ( Basda::DeviceAsync _async = Basda::Device::s_async)
virtual

Implements Basda::MoccaDevice.

◆ moveToNegativeLimitStart() [2/2]

virtual void Basda::MoConNDevice::moveToNegativeLimitStart ( Basda::DeviceAsync _async = Basda::Device::s_async)
virtual

Implements Basda::MoccaDevice.

◆ moveToNegativeLimitWait() [1/2]

virtual void Basda::MoConNDevice::moveToNegativeLimitWait ( Basda::DeviceAsync _async = Basda::Device::s_async)
virtual

Implements Basda::MoccaDevice.

◆ moveToNegativeLimitWait() [2/2]

void Basda::MoConNDevice::moveToNegativeLimitWait ( Basda::DeviceAsync _async = Basda::Device::s_async)
virtual

Implements Basda::MoccaDevice.

◆ moveToPositiveLimit() [1/2]

virtual void Basda::MoConNDevice::moveToPositiveLimit ( Basda::DeviceAsync _async = Basda::Device::s_async)
inlinevirtual

All motors of the device move to the positive software limit switch.

Parameters
_asynchthe call back object

Implements Basda::MoccaDevice.

◆ moveToPositiveLimit() [2/2]

virtual void Basda::MoConNDevice::moveToPositiveLimit ( Basda::DeviceAsync _async = Basda::Device::s_async)
inlinevirtual

All motors of the device move to the positive software limit switch.

Parameters
_asynchthe call back object

Implements Basda::MoccaDevice.

◆ moveToPositiveLimitStart() [1/2]

void Basda::MoConNDevice::moveToPositiveLimitStart ( Basda::DeviceAsync _async = Basda::Device::s_async)
virtual

Implements Basda::MoccaDevice.

◆ moveToPositiveLimitStart() [2/2]

virtual void Basda::MoConNDevice::moveToPositiveLimitStart ( Basda::DeviceAsync _async = Basda::Device::s_async)
virtual

Implements Basda::MoccaDevice.

◆ moveToPositiveLimitWait() [1/2]

virtual void Basda::MoConNDevice::moveToPositiveLimitWait ( Basda::DeviceAsync _async = Basda::Device::s_async)
virtual

Implements Basda::MoccaDevice.

◆ moveToPositiveLimitWait() [2/2]

void Basda::MoConNDevice::moveToPositiveLimitWait ( Basda::DeviceAsync _async = Basda::Device::s_async)
virtual

Implements Basda::MoccaDevice.

◆ open() [1/2]

virtual void Basda::MoConNDevice::open ( )
virtual

This method might be called when the service goes in the INIT state.

It connects to all motor controller.

Right now it initialize the motor, download the configuration file and get the all amplifier information.

Todo:
implementation of the INIT service states

Implements Basda::Device.

◆ open() [2/2]

void Basda::MoConNDevice::open ( void  )
virtual

This method might be called when the service goes in the INIT state.

It connects to all motor controller.

Right now it initialize the motor, download the configuration file and get the all amplifier information.

Todo:
implementation of the INIT service states

Implements Basda::Device.

◆ prepareDirectMove() [1/2]

void Basda::MoConNDevice::prepareDirectMove ( const Nice::NPoint _acceleration,
const Nice::NPoint _velocity,
const Nice::NPoint _deceleration 
)
virtual

This method setup the acceleration anv velocity for a direct point to point move.

Parameters
_acceleration
_velocity
_deceleration

Implements Basda::MoccaNDevice.

◆ prepareDirectMove() [2/2]

void Basda::MoConNDevice::prepareDirectMove ( const Nice::NPoint _acceleration,
const Nice::NPoint _velocity,
const Nice::NPoint _deceleration 
)
virtual

This method setup the acceleration anv velocity for a direct point to point move.

Parameters
_acceleration
_velocity
_deceleration

Implements Basda::MoccaNDevice.

◆ prepareExternalProfile() [1/2]

virtual void Basda::MoConNDevice::prepareExternalProfile ( const Nice::SeqSeqInt _segmentsX,
const Nice::SeqSeqInt _segmentsY,
Basda::DeviceAsync _async = Basda::Device::s_async 
)
virtual

This method prepares a direct point to point movement of a xy device.

The movement starts using the startExternalProfile method without parameter.

Implements Basda::MoccaNDevice.

◆ prepareExternalProfile() [2/2]

void Basda::MoConNDevice::prepareExternalProfile ( const Nice::SeqSeqInt _segmentsX,
const Nice::SeqSeqInt _segmentsY,
Basda::DeviceAsync _async = Basda::Device::s_async 
)
virtual

This method prepares a direct point to point movement of a xy device.

The movement starts using the startExternalProfile method without parameter.

Implements Basda::MoccaNDevice.

◆ prepareMoveSync() [1/2]

void Basda::MoConNDevice::prepareMoveSync ( Nice::BitSet  _motors)
virtual

This method set the motors, which will be moved or stopped synchronously.

With the command parameter the motors connected to the same MoCon card as the first motor of this device, will be programmed to execute the movement synchronously. (Motors of the same device can be connected to different MoCon cards, but this command considers only the motors which belongs to the same card of the first motor of that device.)

All move, stop and abort command can be used to manipulate the motor movement. The command execution of these command will be done with startMoveSync()

Parameters
_motorsThis is a 8 bit number where every bit belongs to a motor (bit 0 = motor 1, ... bit 7 = motor 8) false = motor is not assigned true = motor is assigned
See also
startMoveSync

Implements Basda::MoccaNDevice.

◆ prepareMoveSync() [2/2]

virtual void Basda::MoConNDevice::prepareMoveSync ( Nice::BitSet  _motors)
virtual

This method set the motors, which will be moved or stopped synchronously.

With the command parameter the motors connected to the same MoCon card as the first motor of this device, will be programmed to execute the movement synchronously. (Motors of the same device can be connected to different MoCon cards, but this command considers only the motors which belongs to the same card of the first motor of that device.)

All move, stop and abort command can be used to manipulate the motor movement. The command execution of these command will be done with startMoveSync()

Parameters
_motorsThis is a 8 bit number where every bit belongs to a motor (bit 0 = motor 1, ... bit 7 = motor 8) false = motor is not assigned true = motor is assigned
See also
startMoveSync

Implements Basda::MoccaNDevice.

◆ receiveDataRaw() [1/2]

std::string Basda::MoConNDevice::receiveDataRaw ( std::string  _cardNo,
std::string  _commandID,
std::string  _moduleNo,
std::string  _numberOfLines,
Basda::DeviceAsync _async = Basda::Device::s_async 
)
virtual

This method was requested by Lorenzo Busoni (lbuso.nosp@m.ni@a.nosp@m.rcetr.nosp@m.i.as.nosp@m.tro.i.nosp@m.t 02.03.2012)

It supports a direct communication with the MoCon without to parse the response. BUT THE USER OF THIS METHOD TAKE OVER THE RESPONSIBILITY OF THE CORRECT ERROR HANDLING. THE DRIVER DOES NOT HAVE THE CONTROL OVER THAT DEVICE ANY MORE.

Parameters
_commandIDthe command ID which is defined in the CommandIDs.h
_cardNothe card number
_moduleNothe module number
_retthe allocated space for the returned data
_numberOfLinesThis parameter limitates how many data should be read from the Ethernet buffer. All data are read if the value is -1.
Returns
the return parameter is stored in _ret parameter.
See also
chat

Implements Basda::MoccaNDevice.

◆ receiveDataRaw() [2/2]

virtual std::string Basda::MoConNDevice::receiveDataRaw ( std::string  _cardNo,
std::string  _commandID,
std::string  _moduleNo,
std::string  _numberOfLines,
Basda::DeviceAsync = Basda::Device::s_async 
)
virtual

This method was requested by Lorenzo Busoni (lbuso.nosp@m.ni@a.nosp@m.rcetr.nosp@m.i.as.nosp@m.tro.i.nosp@m.t 02.03.2012)

It supports a direct communication with the MoCon without to parse the response. BUT THE USER OF THIS METHOD TAKE OVER THE RESPONSIBILITY OF THE CORRECT ERROR HANDLING. THE DRIVER DOES NOT HAVE THE CONTROL OVER THAT DEVICE ANY MORE.

Parameters
_commandIDthe command ID which is defined in the CommandIDs.h
_cardNothe card number
_moduleNothe module number
_retthe allocated space for the returned data
_numberOfLinesThis parameter limitates how many data should be read from the Ethernet buffer. All data are read if the value is -1.
Returns
the return parameter is stored in _ret parameter.
See also
chat

Implements Basda::MoccaNDevice.

◆ reset() [1/2]

void Basda::MoConNDevice::reset ( Basda::DeviceAsync _async = Basda::Device::s_async)
virtual

This method might be called when the service will be reseted.

The connection to the modules will be closed and opened again.

Parameters
_asynchthe call back object
Todo:
implementation to reset the service

Implements Basda::Device.

◆ reset() [2/2]

virtual void Basda::MoConNDevice::reset ( Basda::DeviceAsync = Basda::Device::s_async)
virtual

This method might be called when the service will be reseted.

The connection to the modules will be closed and opened again.

Parameters
_asynchthe call back object
Todo:
implementation to reset the service

Implements Basda::Device.

◆ resetFatalError() [1/2]

void Basda::MoConNDevice::resetFatalError ( )
private

This method resets the fatal error.

◆ resetFatalError() [2/2]

void Basda::MoConNDevice::resetFatalError ( )
private

This method resets the fatal error.

◆ setAccelerationSetting() [1/2]

void Basda::MoConNDevice::setAccelerationSetting ( const Nice::NPoint _acceleration)
virtual

Set the acceleration configuration parameter of all motors.

Parameters
_accelerationa vector with the acceleration of all motors

Implements Basda::MoccaNDevice.

◆ setAccelerationSetting() [2/2]

virtual void Basda::MoConNDevice::setAccelerationSetting ( const Nice::NPoint _acceleration)
virtual

Set the acceleration configuration parameter of all motors.

Parameters
_accelerationa vector with the acceleration of all motors

Implements Basda::MoccaNDevice.

◆ setChatType() [1/2]

void Basda::MoConNDevice::setChatType ( std::map< std::string, Nice::ChatLinePtr _chat)

This method allows to use a different kind of Chat class.

This method is necessary to test the device with a MoCon simulator.

◆ setChatType() [2/2]

void Basda::MoConNDevice::setChatType ( std::map< std::string, Nice::ChatLinePtr _chat)

This method allows to use a different kind of Chat class.

This method is necessary to test the device with a MoCon simulator.

◆ setCollision() [1/2]

void Basda::MoConNDevice::setCollision ( Nice::SeqPoint  _collisions)
virtual

This method indicates all motor whether they have a collision or not.

Parameters
_collisionsa sequence of points where x is the indicator for a collision on the negative side and y is the indicator for a collision on the positive side

Implements Basda::MoccaNDevice.

◆ setCollision() [2/2]

void Basda::MoConNDevice::setCollision ( Nice::SeqPoint  _collisions)
virtual

This method indicates all motor whether they have a collision or not.

Parameters
_collisionsa sequence of points where x is the indicator for a collision on the negative side and y is the indicator for a collision on the positive side

Implements Basda::MoccaNDevice.

◆ setDecelerationSetting() [1/2]

virtual void Basda::MoConNDevice::setDecelerationSetting ( const Nice::NPoint _deceleration)
virtual

Set the deceleration configuration parameter of all motors.

Parameters
_decelerationa vector with the deceleration of all motors

Implements Basda::MoccaNDevice.

◆ setDecelerationSetting() [2/2]

void Basda::MoConNDevice::setDecelerationSetting ( const Nice::NPoint _deceleration)
virtual

Set the deceleration configuration parameter of all motors.

Parameters
_decelerationa vector with the deceleration of all motors

Implements Basda::MoccaNDevice.

◆ setIsReachable() [1/2]

void Basda::MoConNDevice::setIsReachable ( const bool  _isReachable)
private

◆ setIsReachable() [2/2]

void Basda::MoConNDevice::setIsReachable ( const bool  _isReachable)
private

◆ setJerkSetting() [1/2]

void Basda::MoConNDevice::setJerkSetting ( const Nice::NPoint _jerk)
virtual

Set the jerk configuration parameter of all motors.

Parameters
_jerka vector with the jerk of all motors

Implements Basda::MoccaNDevice.

◆ setJerkSetting() [2/2]

virtual void Basda::MoConNDevice::setJerkSetting ( const Nice::NPoint _jerk)
virtual

Set the jerk configuration parameter of all motors.

Parameters
_jerka vector with the jerk of all motors

Implements Basda::MoccaNDevice.

◆ setLinkTimeout() [1/2]

virtual void Basda::MoConNDevice::setLinkTimeout ( Nice::Time  _tcpConnectionTimeout)
virtual

This method sets TCP connection timeout.

For each motor, the TCP connection timeout will be stored.

Parameters
_tcpConnectionTimeouta vector with the TCP connection timeout

Implements Basda::MoccaNDevice.

◆ setLinkTimeout() [2/2]

void Basda::MoConNDevice::setLinkTimeout ( Nice::Time  _tcpConnectionTimeout)
virtual

This method sets TCP connection timeout.

For each motor, the TCP connection timeout will be stored.

Parameters
_tcpConnectionTimeouta vector with the TCP connection timeout

Implements Basda::MoccaNDevice.

◆ setMotionComplete() [1/2]

void Basda::MoConNDevice::setMotionComplete ( bool  _complete)
private

Resets the motion complete flag.

This method set back the motion complete flag.

The following property is used

  • VAR.MOTION_COMPLETE

◆ setMotionComplete() [2/2]

void Basda::MoConNDevice::setMotionComplete ( bool  _complete)
private

Resets the motion complete flag.

This method set back the motion complete flag.

The following property is used

  • VAR.MOTION_COMPLETE

◆ setPosition() [1/2]

virtual void Basda::MoConNDevice::setPosition ( const Nice::NPoint _position)
virtual

Change the absolute position of all motors.

The motor will not move, but the MoCon position and incremental psoition will be set to the given position value. The new position value can only be inside the travel range.

Parameters
_positiona vector with the new MoCon and incremental encoder position of all motors

Implements Basda::MoccaNDevice.

◆ setPosition() [2/2]

void Basda::MoConNDevice::setPosition ( const Nice::NPoint _position)
virtual

Change the absolute position of all motors.

The motor will not move, but the MoCon position and incremental psoition will be set to the given position value. The new position value can only be inside the travel range.

Parameters
_positiona vector with the new MoCon and incremental encoder position of all motors

Implements Basda::MoccaNDevice.

◆ setVelocitySetting() [1/2]

virtual void Basda::MoConNDevice::setVelocitySetting ( const Nice::NPoint _velocity)
virtual

Set the velocity configuration parameter of all motors.

Parameters
_velocitya vector with the velocity of all motors

Implements Basda::MoccaNDevice.

◆ setVelocitySetting() [2/2]

void Basda::MoConNDevice::setVelocitySetting ( const Nice::NPoint _velocity)
virtual

Set the velocity configuration parameter of all motors.

Parameters
_velocitya vector with the velocity of all motors

Implements Basda::MoccaNDevice.

◆ startExternalProfile() [1/4]

void Basda::MoConNDevice::startExternalProfile ( const Nice::Date _date,
const Nice::NPoint _positionSequence,
unsigned int  _frequency,
unsigned int  _maxSamplesPerSegment,
unsigned int  _faultTolerance,
Basda::DeviceAsync _async = Basda::Device::s_async 
)
virtual

This method setup and starts the external profile for a XY device.

Parameters
_datethe external profile start date
_positionSequencethe point cloud in steps
_frequencysamples per second
_maxSamplesPerSegmentthe maximal number for samples in a segment
_faultTolerancethe maximal deviation
_async

Implements Basda::MoccaNDevice.

◆ startExternalProfile() [2/4]

virtual void Basda::MoConNDevice::startExternalProfile ( const Nice::Date _date,
const Nice::NPoint _positionSequence,
unsigned int  _frequency,
unsigned int  _maxSamplesPerSegment,
unsigned int  _faultTolerance,
Basda::DeviceAsync _async = Basda::Device::s_async 
)
virtual

This method setup and starts the external profile for a XY device.

Parameters
_datethe external profile start date
_positionSequencethe point cloud in steps
_frequencysamples per second
_maxSamplesPerSegmentthe maximal number for samples in a segment
_faultTolerancethe maximal deviation
_async

Implements Basda::MoccaNDevice.

◆ startExternalProfile() [3/4]

void Basda::MoConNDevice::startExternalProfile ( Basda::DeviceAsync _async = Basda::Device::s_async)
virtual

This method starts a trajectory now.

Implements Basda::MoccaNDevice.

◆ startExternalProfile() [4/4]

virtual void Basda::MoConNDevice::startExternalProfile ( Basda::DeviceAsync _async = Basda::Device::s_async)
virtual

This method starts a trajectory now.

Implements Basda::MoccaNDevice.

◆ startMoveSync() [1/2]

void Basda::MoConNDevice::startMoveSync ( )
virtual

Start the movement of the motors that are programmed with prepareMoveSync() and the move, stop and abort commands before.

See also
prepareMoveSync

Implements Basda::MoccaNDevice.

◆ startMoveSync() [2/2]

virtual void Basda::MoConNDevice::startMoveSync ( )
virtual

Start the movement of the motors that are programmed with prepareMoveSync() and the move, stop and abort commands before.

See also
prepareMoveSync

Implements Basda::MoccaNDevice.

◆ stop() [1/2]

void Basda::MoConNDevice::stop ( )
virtual

This method stops the motor with a deceleration.

Implements Basda::MoccaDevice.

◆ stop() [2/2]

virtual void Basda::MoConNDevice::stop ( )
virtual

This method stops the motor with a deceleration.

Implements Basda::MoccaDevice.

◆ version() [1/2]

virtual void Basda::MoConNDevice::version ( )
virtual

This method returns the version string of the device.

Todo:
implementation of the version string

Implements Basda::Device.

◆ version() [2/2]

void Basda::MoConNDevice::version ( void  )
virtual

This method returns the version string of the device.

Todo:
implementation of the version string

Implements Basda::Device.

◆ waitForNextTrigger() [1/2]

void Basda::MoConNDevice::waitForNextTrigger ( Nice::Date  _date,
Basda::DeviceAsync _async = Basda::Device::s_async 
)

This method wait until the next trigger has tobe raised.

Parameters
_datethe absolute time for the next trigger

◆ waitForNextTrigger() [2/2]

void Basda::MoConNDevice::waitForNextTrigger ( Nice::Date  _date,
Basda::DeviceAsync _async = Basda::Device::s_async 
)

This method wait until the next trigger has tobe raised.

Parameters
_datethe absolute time for the next trigger

Member Data Documentation

◆ m_card

std::map< std::string, MoConCardPtr > Basda::MoConNDevice::m_card
private

This member keeps all card objects.

The key is the connection ID which is composed by the connection address, the card number and the module number.

◆ m_chat

std::map< std::string, Nice::ChatLinePtr > Basda::MoConNDevice::m_chat
private

This member keeps all chat objects.

The original Nice::Chat::Line object can be exchanged with a Chat::LineMock object to simulate the MoCon behavior.

◆ m_completion

Nice::Completion Basda::MoConNDevice::m_completion
private

This member is used to indicate which stop method should be used.

The generic interface call just the stop method in order to stop the current movement or to stop the current running profile. This flag indicates whether the external profile has started and have to be stopped with setExternalProfileStop. But this device allows to move the motors via the standard move commands as long as the programmed start time is not reached. In that case the standard move commands have to temporarily set back the flag in order to stop the move command and have to restore the flag when the command is executed.

◆ m_currentPosition

Nice::NPoint Basda::MoConNDevice::m_currentPosition
private

◆ m_extended

bool Basda::MoConNDevice::m_extended
private

◆ m_externalProfileInfo

int Basda::MoConNDevice::m_externalProfileInfo
private

Keeps the last external profile info value to reduce the number of log messages.

◆ m_externalProfileSize

unsigned int Basda::MoConNDevice::m_externalProfileSize
private

◆ m_isReachable

bool Basda::MoConNDevice::m_isReachable
private

◆ m_module

std::map< std::string, MoConModulePtr > Basda::MoConNDevice::m_module
private

This member keeps all module objects.

The key is the connection ID which is composed by the connection address, the card number and the module number.

◆ m_mutex

Nice::Mutex Basda::MoConNDevice::m_mutex
private

◆ m_protocol

std::map< std::string, MPIACoreProtocolPtr > Basda::MoConNDevice::m_protocol
private

This method resets the fatal error.

Todo:
implementation

This member keeps all connection to the MoCon. The key is the connection address.

Todo:
implementation

This member keeps all connection to the MoCon. The key is the connection address.

◆ m_startPosition

Nice::NPoint Basda::MoConNDevice::m_startPosition
private

◆ m_targetPositions

Nice::NPoint Basda::MoConNDevice::m_targetPositions
private

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