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

#include <LaosStarEnlarger.h>

Inheritance diagram for Laos::StarEnlarger:
Inheritance graph
Collaboration diagram for Laos::StarEnlarger:
Collaboration graph

Public Member Functions

 StarEnlarger (const std::string _name, const Nice::JointPtr &_config, const Basda::MoccaNDevicePtr &_device, const std::string _basicUnit, const std::string _basicCoordSys)
 
virtual ~StarEnlarger ()
 
virtual void open ()
 
virtual void close ()
 
virtual void init (Basda::DeviceAsync &=Basda::Device::s_async)
 
virtual void deinit (Basda::DeviceAsync &=Basda::Device::s_async)
 
virtual void activate (Basda::DeviceAsync &=Basda::Device::s_async)
 
virtual void deactivate (Basda::DeviceAsync &=Basda::Device::s_async)
 
virtual int getID ()
 
virtual Nice::SeqString getConnectionAddress ()
 
virtual Nice::SeqInt getModuleNumber ()
 
virtual Nice::SeqTime getLinkTimeout ()
 
virtual bool isReachable ()
 
virtual bool isAtHome ()
 
virtual bool isAtLimit ()
 
virtual bool isMoving ()
 
virtual bool isCfgEnabled ()
 
virtual void setEnabled (bool _enabled, Nice::Point _position)
 
virtual void setCollision (Nice::BitSet _collision)
 
virtual Nice::Point getDeviceEncoderPosition (std::string _unit, std::string _coordSys)
 
virtual Nice::Point readDeviceEncoderPosition (std::string _unit, std::string _coordSys)
 
virtual Nice::Point getIncrementalEncoderPosition (std::string _unit, std::string _coordSys)
 
virtual Nice::Point readIncrementalEncoderPosition (std::string _unit, std::string _coordSys)
 
virtual bool isCurrentlyEnabled ()
 
virtual void setPosition (const Nice::Point &_position, std::string _unit, std::string _coordSys)
 
virtual Nice::Point getPredictedPosition (Nice::Time &_time)
 
virtual Nice::Point getPredictedPosition (int _cycle)
 
virtual void stop ()
 
virtual void abort ()
 
void storeMotorConfig ()
 
virtual void prepareMoveSync (Nice::BitSet _motors)
 
virtual void startMoveSync ()
 
virtual void moveAbsoluteGetReady (Basda::DeviceAsync &=Basda::Device::s_async)
 The method prepares a trapezoidal point-to-point profile movement. More...
 
virtual void moveAbsoluteStart (const Nice::Point &_position, std::string _unit, std::string _coordSys, Basda::DeviceAsync &=Basda::Device::s_async)
 Move the Star enlarger to the target position. More...
 
virtual void moveRelativeGetReady (Basda::DeviceAsync &=Basda::Device::s_async)
 The method prepares a trapezoidal point-to-point profile movement. More...
 
virtual void moveRelativeStart (const Nice::Point &_distance, std::string _unit, std::string _coordSys, Basda::DeviceAsync &=Basda::Device::s_async)
 Move the Star enlarger by a distance. More...
 
virtual void moveToHomeSingleStart (const int _motor, Basda::DeviceAsync &=Basda::Device::s_async)
 Move the Star enlarger to its home position. More...
 
virtual void moveToHomeStart (Basda::DeviceAsync &=Basda::Device::s_async)
 
virtual void moveToLimitStart (const Nice::NPoint &_limit, Basda::DeviceAsync &_async=Basda::Device::s_async)
 
virtual void retreatToBase (Basda::DeviceAsync &_async=Basda::Device::s_async)
 Move to the position (x,0), which means keep x and reduce y (extending into the field) to zero. More...
 
virtual bool posReachable (const Nice::Point &_targetPosition, std::string _unit)
 Test whether the target is in the focal plane range of the motor. More...
 
virtual void prepareDirectP2PMove (const Nice::Point &_targetPosition, std::string _unit, std::string _coordSys, bool _absolute, Basda::DeviceAsync &=Basda::Device::s_async)
 
virtual QPolygon getSilhouetteAtPosition (Nice::Point _point)
 Returns the star enlarger silhouette at the given position. More...
 
virtual Nice::Time getMinTravelTime ()
 
virtual Nice::Time getP2PTravelTime ()
 
int getProgress ()
 
virtual void transformationFactorChanged (const Nice::Any &)
 This method will be called automatically whenever the transformation property has changed. More...
 
virtual Nice::WMatrix getCoordinateTransformationMatrix (std::string _unit, std::string _coordSys)
 This method returns user defined wmatrix. More...
 
virtual Nice::Rect getTravelrange ()
 This method returns travelrange. More...
 
virtual Nice::Point coordinateTransformation (Nice::Point _value, std::string _unit, std::string _coordSys)
 This method converts an absolute position into a user defined unit. Thereby it uses the vector dx and dy of the conversion matrix. More...
 
virtual Nice::Point coordinateTransformationInverse (Nice::Point _value, std::string _unit, std::string _coordSys)
 
virtual Nice::Point coordinateTranslate (Nice::Point _value, std::string _unit, std::string _coordSys)
 
virtual Nice::Point coordinateTranslateInverse (Nice::Point _value, std::string _unit, std::string _coordSys)
 
std::map< std::string, int > getUnitNamePrec ()
 
std::string getDefaultUnit ()
 
std::string getDefaultCoordinateSystem ()
 
void writeDeviation ()
 

Private Member Functions

void defineCoordinateSystem ()
 
void createSESilhouette ()
 
void measureShortestEdge ()
 
Nice::SeqSeqInt calculateDirectP2PMove (double _d, double _v, double _a, double _currentPositionInSteps, double _targetPositionInSteps)
 
double predictPosition (Nice::SeqSeqInt &_segments, Nice::Time &_time)
 
void setScientificNotification (std::stringstream &_errorMsg, double _number)
 
QString getDir ()
 
QString getTime (QString _dir)
 

Private Attributes

Nice::JointPtr m_config
 
Basda::MoccaNDevicePtr m_device
 
Nice::Point m_positionInFocalPlane
 
QPolygon m_silhouetteAtOrigin
 
QPolygon m_silhouetteTransform
 
long double m_dmin
 
int m_cyclesDmin
 
int m_p2pTravelCycles
 
double m_cycleTime
 
std::map< std::string, Nice::WMatrixm_transformation
 A vector with the coordinate transformation matrixes. More...
 
Nice::Point m_homePositionInSteps
 
Nice::Point m_travelRangeX
 
Nice::Point m_travelRangeY
 
std::string m_name
 
int m_ID
 
Nice::SeqString m_address
 
Nice::SeqInt m_moduleNumber
 
std::string m_basicUnit
 
std::string m_basicCoordSys
 
std::string m_defaultUnit
 
std::string m_defaultCoordSys
 
int m_numberOfUnits
 
std::map< std::string, int > m_unitNamePrecMap
 
Nice::JointPtr m_basicResolutionPropertyX
 
Nice::JointPtr m_basicVelocityPropertyX
 
Nice::JointPtr m_basicAccelerationPropertyX
 
Nice::JointPtr m_basicResolutionPropertyY
 
Nice::JointPtr m_basicVelocityPropertyY
 
Nice::JointPtr m_basicAccelerationPropertyY
 
Nice::NPoint m_basicVelocity
 
Nice::NPoint m_basicAcceleration
 
int m_travelVelocityX
 
int m_travelAccelerationX
 
int m_travelVelocityY
 
int m_travelAccelerationY
 
Nice::SeqSeqInt m_profileX
 The MoCon profile vector consist of segments. More...
 
Nice::SeqSeqInt m_profileY
 
Nice::SeqSeqInt m_deviations
 
Nice::SeqInt m_deviation
 

Constructor & Destructor Documentation

◆ StarEnlarger()

Laos::StarEnlarger::StarEnlarger ( const std::string  _name,
const Nice::JointPtr _config,
const Basda::MoccaNDevicePtr _device,
const std::string  _basicUnit,
const std::string  _basicCoordSys 
)

◆ ~StarEnlarger()

Laos::StarEnlarger::~StarEnlarger ( )
virtual

Member Function Documentation

◆ abort()

void Laos::StarEnlarger::abort ( void  )
virtual

◆ activate()

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

◆ calculateDirectP2PMove()

Nice::SeqSeqInt Laos::StarEnlarger::calculateDirectP2PMove ( double  _d,
double  _v,
double  _a,
double  _currentPositionInSteps,
double  _targetPositionInSteps 
)
private

◆ close()

void Laos::StarEnlarger::close ( )
virtual

◆ coordinateTransformation()

Nice::Point Laos::StarEnlarger::coordinateTransformation ( Nice::Point  _value,
std::string  _unit,
std::string  _coordSys 
)
virtual

This method converts an absolute position into a user defined unit. Thereby it uses the vector dx and dy of the conversion matrix.


Parameters
_valueabsolute position value in SE steps
_unitthe unit in which the _value has to be converted
_coordSysthe coordinate system in which the _value has to be converted
Returns
position value in _coordSys and _unit

◆ coordinateTransformationInverse()

Nice::Point Laos::StarEnlarger::coordinateTransformationInverse ( Nice::Point  _value,
std::string  _unit,
std::string  _coordSys 
)
virtual

This method converts an absolute position into an absolute position in steps. Thereby it uses the vector dx and dy of the conversion matrix.

Parameters
_valueposition value
_unitthe unit of _value
_coordSyscoordinate system of _value
Returns
position value in SE steps

◆ coordinateTranslate()

Nice::Point Laos::StarEnlarger::coordinateTranslate ( Nice::Point  _value,
std::string  _unit,
std::string  _coordSys 
)
virtual

This method converts a distance into a distance in user defined unit. Thereby it ignores the vector dx and dy of the conversion matrix.

Parameters
_valuedistance in SE steps
_unitthe unit in which the _value has to be converted
_coordSysthe coordinate system in which the _value has to be converted
Returns
distance value in _coordSys and _unit

◆ coordinateTranslateInverse()

Nice::Point Laos::StarEnlarger::coordinateTranslateInverse ( Nice::Point  _value,
std::string  _unit,
std::string  _coordSys 
)
virtual

This method converts a distance into a distance in SE steps. Thereby it ignores the vector dx and dy of the conversion matrix.

Parameters
_valuedistance
_unitthe unit of _value
_coordSyscoordinate system of _value
Returns
position value in SE steps

◆ createSESilhouette()

void Laos::StarEnlarger::createSESilhouette ( )
private

◆ deactivate()

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

◆ defineCoordinateSystem()

void Laos::StarEnlarger::defineCoordinateSystem ( )
private

◆ deinit()

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

◆ getConnectionAddress()

Nice::SeqString Laos::StarEnlarger::getConnectionAddress ( )
virtual

◆ getCoordinateTransformationMatrix()

Nice::WMatrix Laos::StarEnlarger::getCoordinateTransformationMatrix ( std::string  _unit,
std::string  _coordSys 
)
virtual

This method returns user defined wmatrix.


Parameters
_unitthe unit in which the _value has to be converted
_coordSysthe coordinate system in which the _value has to be converted
Returns
wmatrix _coordSys and _unit

◆ getDefaultCoordinateSystem()

std::string Laos::StarEnlarger::getDefaultCoordinateSystem ( )

◆ getDefaultUnit()

std::string Laos::StarEnlarger::getDefaultUnit ( )

◆ getDeviceEncoderPosition()

Nice::Point Laos::StarEnlarger::getDeviceEncoderPosition ( std::string  _unit,
std::string  _coordSys 
)
virtual

◆ getDir()

QString Laos::StarEnlarger::getDir ( )
private

◆ getID()

int Laos::StarEnlarger::getID ( )
virtual

◆ getIncrementalEncoderPosition()

Nice::Point Laos::StarEnlarger::getIncrementalEncoderPosition ( std::string  _unit,
std::string  _coordSys 
)
virtual

◆ getLinkTimeout()

Nice::SeqTime Laos::StarEnlarger::getLinkTimeout ( )
virtual

◆ getMinTravelTime()

Nice::Time Laos::StarEnlarger::getMinTravelTime ( )
virtual

◆ getModuleNumber()

Nice::SeqInt Laos::StarEnlarger::getModuleNumber ( )
virtual

◆ getP2PTravelTime()

Nice::Time Laos::StarEnlarger::getP2PTravelTime ( )
virtual

◆ getPredictedPosition() [1/2]

Nice::Point Laos::StarEnlarger::getPredictedPosition ( Nice::Time _time)
virtual

◆ getPredictedPosition() [2/2]

Nice::Point Laos::StarEnlarger::getPredictedPosition ( int  _cycle)
virtual

◆ getProgress()

int Laos::StarEnlarger::getProgress ( )

◆ getSilhouetteAtPosition()

QPolygon Laos::StarEnlarger::getSilhouetteAtPosition ( Nice::Point  _pointInSteps)
virtual

Returns the star enlarger silhouette at the given position.


Parameters
_pointthe position in steps
Returns
the SE silhouette in focal plane coordinates

◆ getTime()

QString Laos::StarEnlarger::getTime ( QString  _dir)
private

◆ getTravelrange()

Nice::Rect Laos::StarEnlarger::getTravelrange ( )
virtual

This method returns travelrange.


Returns
travelrange in steps

◆ getUnitNamePrec()

std::map< std::string, int > Laos::StarEnlarger::getUnitNamePrec ( )

◆ init()

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

◆ isAtHome()

bool Laos::StarEnlarger::isAtHome ( )
virtual

◆ isAtLimit()

bool Laos::StarEnlarger::isAtLimit ( )
virtual

◆ isCfgEnabled()

bool Laos::StarEnlarger::isCfgEnabled ( )
virtual

◆ isCurrentlyEnabled()

bool Laos::StarEnlarger::isCurrentlyEnabled ( )
virtual

◆ isMoving()

bool Laos::StarEnlarger::isMoving ( )
virtual

◆ isReachable()

bool Laos::StarEnlarger::isReachable ( )
virtual

◆ measureShortestEdge()

void Laos::StarEnlarger::measureShortestEdge ( )
private

◆ moveAbsoluteGetReady()

void Laos::StarEnlarger::moveAbsoluteGetReady ( Basda::DeviceAsync _async = Basda::Device::s_async)
virtual

The method prepares a trapezoidal point-to-point profile movement.


The basic configuration parameter acceleration, deceleration, velocity and jerk are calculated and set in the Mocon.

Parameters
_asyncthe call back object

◆ moveAbsoluteStart()

void Laos::StarEnlarger::moveAbsoluteStart ( const Nice::Point _position,
std::string  _unit,
std::string  _coordSys,
Basda::DeviceAsync _async = Basda::Device::s_async 
)
virtual

Move the Star enlarger to the target position.


Parameters
_positionthe target position value
_unitthe unit of the position values
_asyncthe call back object

◆ moveRelativeGetReady()

void Laos::StarEnlarger::moveRelativeGetReady ( Basda::DeviceAsync _async = Basda::Device::s_async)
virtual

The method prepares a trapezoidal point-to-point profile movement.


The basic configuration parameter acceleration, deceleration, velocity and jerk are calculated and set in the Mocon.

Parameters
_asyncthe call back object

◆ moveRelativeStart()

void Laos::StarEnlarger::moveRelativeStart ( const Nice::Point _distance,
std::string  _unit,
std::string  _coordSys,
Basda::DeviceAsync _async = Basda::Device::s_async 
)
virtual

Move the Star enlarger by a distance.


Parameters
_distance
_unitthe unit of the position values
_asyncthe call back object

◆ moveToHomeSingleStart()

void Laos::StarEnlarger::moveToHomeSingleStart ( const int  _motor,
Basda::DeviceAsync _async = Basda::Device::s_async 
)
virtual

Move the Star enlarger to its home position.


Parameters
_motorthe index of the motor (the motors are alphabetically sorted by names; index 0 means the first entry in the list)
_asyncthe call back object

◆ moveToHomeStart()

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

◆ moveToLimitStart()

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

◆ open()

void Laos::StarEnlarger::open ( void  )
virtual

◆ posReachable()

bool Laos::StarEnlarger::posReachable ( const Nice::Point _targetPosition,
std::string  _unit 
)
virtual

Test whether the target is in the focal plane range of the motor.


This is simpler than StarEnlargerServiceWorker::validateMoveTo: it just checks that the target is in range, but does not check whether any pairs or sets of motions would collide.

Parameters
_targetPositionThe position to be checked (in the global x,y system)
_unitThe unit of the _targetPosition
Returns
true if the target is in the travel range of the motor, false if outside.
Since
2017-03-09
Author
R. J. Mathar
Deprecated:
since a the StarEnlargerServiceWorker::validateMoveTo delivers essentially the same information

◆ predictPosition()

double Laos::StarEnlarger::predictPosition ( Nice::SeqSeqInt _segments,
Nice::Time _time 
)
private

◆ prepareDirectP2PMove()

void Laos::StarEnlarger::prepareDirectP2PMove ( const Nice::Point _targetPosition,
std::string  _unit,
std::string  _coordSys,
bool  _absolute,
Basda::DeviceAsync = Basda::Device::s_async 
)
virtual

◆ prepareMoveSync()

void Laos::StarEnlarger::prepareMoveSync ( Nice::BitSet  _motors)
virtual

◆ readDeviceEncoderPosition()

Nice::Point Laos::StarEnlarger::readDeviceEncoderPosition ( std::string  _unit,
std::string  _coordSys 
)
virtual

◆ readIncrementalEncoderPosition()

Nice::Point Laos::StarEnlarger::readIncrementalEncoderPosition ( std::string  _unit,
std::string  _coordSys 
)
virtual

◆ retreatToBase()

void Laos::StarEnlarger::retreatToBase ( Basda::DeviceAsync _async = Basda::Device::s_async)
virtual

Move to the position (x,0), which means keep x and reduce y (extending into the field) to zero.


Author
R. J. Mathar
Since
2017-07-02

◆ setCollision()

void Laos::StarEnlarger::setCollision ( Nice::BitSet  _collision)
virtual

◆ setEnabled()

void Laos::StarEnlarger::setEnabled ( bool  _enabled,
Nice::Point  _position 
)
virtual


enables the SE device and updates all position property values the parameter _position is in [um]

◆ setPosition()

void Laos::StarEnlarger::setPosition ( const Nice::Point _position,
std::string  _unit,
std::string  _coordSys 
)
virtual

◆ setScientificNotification()

void Laos::StarEnlarger::setScientificNotification ( std::stringstream &  _errorMsg,
double  _number 
)
private

◆ startMoveSync()

void Laos::StarEnlarger::startMoveSync ( )
virtual

◆ stop()

void Laos::StarEnlarger::stop ( )
virtual

◆ storeMotorConfig()

void Laos::StarEnlarger::storeMotorConfig ( )

◆ transformationFactorChanged()

void Laos::StarEnlarger::transformationFactorChanged ( const Nice::Any )
virtual

This method will be called automatically whenever the transformation property has changed.


◆ writeDeviation()

void Laos::StarEnlarger::writeDeviation ( )

Member Data Documentation

◆ m_address

Nice::SeqString Laos::StarEnlarger::m_address
private

◆ m_basicAcceleration

Nice::NPoint Laos::StarEnlarger::m_basicAcceleration
private

◆ m_basicAccelerationPropertyX

Nice::JointPtr Laos::StarEnlarger::m_basicAccelerationPropertyX
private

◆ m_basicAccelerationPropertyY

Nice::JointPtr Laos::StarEnlarger::m_basicAccelerationPropertyY
private

◆ m_basicCoordSys

std::string Laos::StarEnlarger::m_basicCoordSys
private

◆ m_basicResolutionPropertyX

Nice::JointPtr Laos::StarEnlarger::m_basicResolutionPropertyX
private

◆ m_basicResolutionPropertyY

Nice::JointPtr Laos::StarEnlarger::m_basicResolutionPropertyY
private

◆ m_basicUnit

std::string Laos::StarEnlarger::m_basicUnit
private

◆ m_basicVelocity

Nice::NPoint Laos::StarEnlarger::m_basicVelocity
private

◆ m_basicVelocityPropertyX

Nice::JointPtr Laos::StarEnlarger::m_basicVelocityPropertyX
private

◆ m_basicVelocityPropertyY

Nice::JointPtr Laos::StarEnlarger::m_basicVelocityPropertyY
private

◆ m_config

Nice::JointPtr Laos::StarEnlarger::m_config
private

◆ m_cyclesDmin

int Laos::StarEnlarger::m_cyclesDmin
private

◆ m_cycleTime

double Laos::StarEnlarger::m_cycleTime
private

◆ m_defaultCoordSys

std::string Laos::StarEnlarger::m_defaultCoordSys
private

◆ m_defaultUnit

std::string Laos::StarEnlarger::m_defaultUnit
private

◆ m_deviation

Nice::SeqInt Laos::StarEnlarger::m_deviation
private

◆ m_deviations

Nice::SeqSeqInt Laos::StarEnlarger::m_deviations
private

◆ m_device

Basda::MoccaNDevicePtr Laos::StarEnlarger::m_device
private

◆ m_dmin

long double Laos::StarEnlarger::m_dmin
private

◆ m_homePositionInSteps

Nice::Point Laos::StarEnlarger::m_homePositionInSteps
private

◆ m_ID

int Laos::StarEnlarger::m_ID
private

◆ m_moduleNumber

Nice::SeqInt Laos::StarEnlarger::m_moduleNumber
private

◆ m_name

std::string Laos::StarEnlarger::m_name
private

◆ m_numberOfUnits

int Laos::StarEnlarger::m_numberOfUnits
private

◆ m_p2pTravelCycles

int Laos::StarEnlarger::m_p2pTravelCycles
private

◆ m_positionInFocalPlane

Nice::Point Laos::StarEnlarger::m_positionInFocalPlane
private

◆ m_profileX

Nice::SeqSeqInt Laos::StarEnlarger::m_profileX
private

The MoCon profile vector consist of segments.

◆ m_profileY

Nice::SeqSeqInt Laos::StarEnlarger::m_profileY
private

◆ m_silhouetteAtOrigin

QPolygon Laos::StarEnlarger::m_silhouetteAtOrigin
private

◆ m_silhouetteTransform

QPolygon Laos::StarEnlarger::m_silhouetteTransform
private

◆ m_transformation

std::map<std::string, Nice::WMatrix> Laos::StarEnlarger::m_transformation
private

A vector with the coordinate transformation matrixes.

It is also used to convert between the different units (eg. um to steps)

◆ m_travelAccelerationX

int Laos::StarEnlarger::m_travelAccelerationX
private

◆ m_travelAccelerationY

int Laos::StarEnlarger::m_travelAccelerationY
private

◆ m_travelRangeX

Nice::Point Laos::StarEnlarger::m_travelRangeX
private

◆ m_travelRangeY

Nice::Point Laos::StarEnlarger::m_travelRangeY
private

◆ m_travelVelocityX

int Laos::StarEnlarger::m_travelVelocityX
private

◆ m_travelVelocityY

int Laos::StarEnlarger::m_travelVelocityY
private

◆ m_unitNamePrecMap

std::map<std::string, int> Laos::StarEnlarger::m_unitNamePrecMap
private

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