TwiceAsNice  2019-02-18
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
Laos::StarEnlargerServiceWorker Class Reference

#include <LaosStarEnlargerServiceWorker.h>

Inheritance diagram for Laos::StarEnlargerServiceWorker:
Inheritance graph
Collaboration diagram for Laos::StarEnlargerServiceWorker:
Collaboration graph

Classes

struct  DeviceAsyncImpl
 
struct  DeviceCmdAsyncImpl
 This struct is the implementation of the asynchronous command status method. More...
 

Public Member Functions

 StarEnlargerServiceWorker (const Nice::JointPtr &_config, Basda::MoccaCDevicePtr _coconDevice, std::vector< Basda::MoccaNDevicePtr > _moconDevice)
 
virtual ~StarEnlargerServiceWorker ()
 
virtual void init ()
 
virtual void deinit ()
 
virtual void activate ()
 
virtual void deactivate ()
 
virtual void terminate ()
 schedule EXIT as the next target state. More...
 
virtual void errorOffline ()
 set the target state to OFFLINE. More...
 
virtual void errorStandby ()
 set the target state to OFFLINE. More...
 
virtual void errorOnline ()
 set the target state to OFFLINE. More...
 
virtual void errorWorking ()
 set the target state to OFFLINE. More...
 
virtual void idleOffline ()
 wait for a state change. More...
 
virtual void idleOnline ()
 wait for a state change. More...
 
virtual void stop ()
 does nothing. More...
 
virtual void abort ()
 does nothing. More...
 
virtual bool isReachable ()
 
virtual bool isAtHome ()
 
virtual bool isAtLimit ()
 
virtual bool isMoving ()
 
virtual bool isCurrentlyEnabled (std::string _device)
 
virtual void getCollision ()
 
virtual void setCollision ()
 
virtual void resetCollision ()
 
virtual Nice::MapStringPoint getPosition ()
 
virtual Nice::MapStringPoint getPosition (std::string _unit, std::string _coordSys, bool _devEncoder=true)
 
virtual Nice::MapStringRect getTravelrange ()
 
virtual Nice::MapStringWMatrix getTransformation (std::string _unit="UM", std::string _coordSys="F")
 
virtual void setPosition (std::string _name, const Nice::Point &_position)
 
virtual Nice::MapStringPoint convertPosition (const Nice::MapStringPoint &_position, bool _fromAbsolute, std::string _fromUnit, std::string _fromCoordSys, bool _toAbsolute, std::string _toUnit, std::string _toCoordSys)
 
std::map< std::string, Nice::BitSetidentifyMovingMotors (Nice::MapStringPoint _positions, std::string _unit, std::string _coordSys, bool _absolute)
 
virtual bool validateMoveTo (const Nice::MapStringPoint &_positions, std::string _unit, std::string _coordSys)
 
virtual void moveTo (const Nice::MapStringPoint &_positions, std::string _unit, std::string _coordSys)
 
virtual void retreatToBase (const Nice::MapStringPoint &_positions)
 Move the y-positions of all devices in the _positions to zero. Effectively this retreats all motors to their base positions, keeping the x component and minimizing the amount the individual motors stick into the common area. The implementation is serialized, which means, the motors move individually in the order detailed in the _positions, and the next motor moves once the previous motor has settled to its base position. More...
 
virtual bool validateMoveBy (const Nice::MapStringPoint &_distance, std::string _unit, std::string _coordSys)
 
virtual void moveBy (const Nice::MapStringPoint &_distance, std::string _unit, std::string _coordSys)
 
virtual void moveToStart (std::string _name, const Nice::Point &_position, std::string _unit, std::string _coordSys)
 Start moving a motor to an absolute position. If the motor is not enabled, it will not be moved. More...
 
virtual void moveToWait ()
 
virtual void moveByStart (std::string _name, const Nice::Point &_position, std::string _unit, std::string _coordSys)
 Start moving a motor by a relative amount. If the motor is not enabled, it will not be moved. More...
 
virtual void moveByWait ()
 
virtual void moveToLimitStart (std::string _name, const Nice::Point &_limit)
 Start moving a motor to a combined limit in both coordinates. If the motor is not enabled, it will not be moved. More...
 
virtual void moveToLimitWait ()
 
virtual void moveToHomeSingleStart (std::string _name, const int _motor)
 Start moving a motor to its home position. If the motor is not enabled, it will not be moved. More...
 
virtual void moveToHomeSingleWait ()
 
virtual void moveToHomeStart (std::string _name)
 Start moving a motor to its home position. If the motor is not enabled, it will not be moved. More...
 
virtual void moveToHomeWait ()
 
virtual void moveToHome ()
 
virtual void setTargets (const Nice::MapStringPoint &)
 
virtual void setEnabledDevice (std::string _device, bool _enable, const Nice::Point &_position)
 
virtual void setEnabledDevices (const Nice::MapStringPoint &_positions, Nice::DynamicBitset _enable)
 
- Public Member Functions inherited from Laos::StarEnlargerServiceWorkerSkeleton
 StarEnlargerServiceWorkerSkeleton (const Nice::JointPtr &_config)
 
virtual ~StarEnlargerServiceWorkerSkeleton ()
 
 StarEnlargerServiceWorkerSkeleton (const Nice::JointPtr &_config)
 
virtual ~StarEnlargerServiceWorkerSkeleton ()
 
- Public Member Functions inherited from Basda::ServiceWorkerSkeleton
const Nice::PropertyPtrcmd ()
 
void setCompletion (const Nice::Completion &_c)
 
void cmdStart (const std::string &_action="")
 
void cmdDone ()
 
void cmdWarning (const std::string &_l)
 
void cmdWarning (const Nice::LoggerObject &_o)
 
void cmdError (const std::string &_l)
 
void cmdError (const Nice::LoggerObject &_o)
 
void cmdError (const Nice::SeqLoggerObject &_oo)
 
void cmdPercent (Nice::Int _v)
 
void cmdAction (Nice::Int _v, const std::string &_s)
 
virtual void cmd (const Nice::Completion &_c)
 
template<typename DataType >
Nice::Completion exec (const Nice::Completion &_c, DataType &_localdata, const DataType &_indata=DataType())
 if currently online, push the state into WORKING More...
 
template<typename DataType >
void execCommand (DataType _cmd)
 
const Nice::PropertyPtrcmd ()
 
void setCompletion (const Nice::Completion &_c)
 
void cmdStart (const std::string &_action="")
 
void cmdDone ()
 
void cmdWarning (const std::string &_l)
 
void cmdWarning (const Nice::LoggerObject &_o)
 
void cmdError (const std::string &_l)
 
void cmdError (const Nice::LoggerObject &_o)
 
void cmdError (const Nice::SeqLoggerObject &_oo)
 
void cmdPercent (Nice::Int _v)
 
void cmdAction (Nice::Int _v, const std::string &_s)
 
virtual void cmd (const Nice::Completion &_c)
 
template<typename DataType >
Nice::Completion exec (const Nice::Completion &_c, DataType &_localdata, const DataType &_indata=DataType())
 
template<typename DataType >
void execCommand (DataType _cmd)
 
- Public Member Functions inherited from Basda::ServiceWorker
const Nice::JointPtrconfig ()
 
Nice::JointPtr cfg ()
 
Nice::JointPtr var ()
 
virtual const std::string & name ()
 
virtual WorkerThreadPtr worker ()
 
virtual Nice::Monitormonitor ()
 
virtual void lock ()
 
virtual void unlock ()
 
bool stateIsSettled ()
 
bool stateHasChanged ()
 
void changeState (Basda::ServiceState _state)
 change state to a new state If the state is the current state, or a negative state, do nothing. Otherwise change the "next" state in the state machine and notify all threads. More...
 
bool tryChangeState (Basda::ServiceState _state, const Nice::Time &_timeout=Nice::Time::seconds(0.0))
 change state to a new state More...
 
void waitForState (Basda::ServiceState _state)
 wait (indefinitely) until the worker has reached a spcifici state More...
 
bool timedWaitForState (Basda::ServiceState _state, const Nice::Time &_timeout)
 wait (indefinitely) until the worker has reached a specific state More...
 
bool changeStateOnlyFromTo (Basda::ServiceState _from, Basda::ServiceState _to)
 wait (indefinitely) until the worker has reached a spcifici state More...
 
Basda::ServiceState state ()
 
Basda::ServiceState stateNow ()
 
Basda::ServiceState stateNext ()
 
Basda::ServiceState stateLast ()
 
bool isTransit ()
 
bool isTerminated ()
 
const Nice::JointPtrconfig ()
 
Nice::JointPtr cfg ()
 
Nice::JointPtr var ()
 
virtual const std::string & name ()
 
virtual WorkerThreadPtr worker ()
 
virtual Nice::Monitormonitor ()
 
virtual void lock ()
 
virtual void unlock ()
 
bool stateIsSettled ()
 
bool stateHasChanged ()
 
void changeState (Basda::ServiceState _state)
 
bool tryChangeState (Basda::ServiceState _state, const Nice::Time &_timeout=Nice::Time::seconds(0.0))
 
void waitForState (Basda::ServiceState _state)
 
bool timedWaitForState (Basda::ServiceState _state, const Nice::Time &_timeout)
 
bool changeStateOnlyFromTo (Basda::ServiceState _from, Basda::ServiceState _to)
 
Basda::ServiceState state ()
 
Basda::ServiceState stateNow ()
 
Basda::ServiceState stateNext ()
 
Basda::ServiceState stateLast ()
 
bool isTransit ()
 
bool isTerminated ()
 

Protected Member Functions

virtual void status ()
 
void predict ()
 predict the time to reach the target positions and detect collisions. More...
 
- Protected Member Functions inherited from Laos::StarEnlargerServiceWorkerSkeleton
const char * isReachableNode ()
 
const char * convertPositionNode ()
 
void convertPositionInit (const Nice::MapStringPoint &_position, bool _from_absolute, std::string _from_unit, std::string _from_coordinate_system, bool _to_absolute, std::string _to_unit, std::string _to_coordinate_system)
 
const char * getPositionNode ()
 
void getPositionInit (std::string _unit, std::string _coordinate_system, bool _dev_enc)
 
const char * setTargetsNode ()
 
void setTargetsInit (const Nice::MapStringPoint &_position)
 
const char * resetCollisionNode ()
 
const char * isCurrentlyEnabledNode ()
 
void isCurrentlyEnabledInit (std::string _device)
 
const char * getTravelrangeNode ()
 
const char * getTransformationNode ()
 
void getTransformationInit (std::string _unit, std::string _coordinate_system)
 
const char * moveToNode ()
 
void moveToInit (const Nice::MapStringPoint &_positions, std::string _unit, std::string _coordinate_system)
 
const char * retreatToBaseNode ()
 
void retreatToBaseInit (const Nice::MapStringPoint &_positions)
 
const char * moveByNode ()
 
void moveByInit (const Nice::MapStringPoint &_distance, std::string _unit, std::string _coordinate_system)
 
const char * moveToHomeNode ()
 
const char * validateMoveToNode ()
 
void validateMoveToInit (const Nice::MapStringPoint &_positions, std::string _unit, std::string _coordinate_system)
 
const char * validateMoveByNode ()
 
void validateMoveByInit (const Nice::MapStringPoint &_distance, std::string _unit, std::string _coordinate_system)
 
const char * setEnabledDeviceNode ()
 
void setEnabledDeviceInit (std::string _device, bool _enable, const Nice::Point &_position)
 
const char * setEnabledDevicesNode ()
 
void setEnabledDevicesInit (const Nice::MapStringPoint &_positions, Nice::DynamicBitset _enable)
 
virtual void work ()
 
const char * isReachableNode ()
 
const char * convertPositionNode ()
 
void convertPositionInit (const Nice::MapStringPoint &_position, bool _from_absolute, std::string _from_unit, std::string _from_coordinate_system, bool _to_absolute, std::string _to_unit, std::string _to_coordinate_system)
 
const char * getPositionNode ()
 
void getPositionInit (std::string _unit, std::string _coordinate_system, bool _dev_enc)
 
const char * setTargetsNode ()
 
void setTargetsInit (const Nice::MapStringPoint &_position)
 
const char * resetCollisionNode ()
 
const char * isCurrentlyEnabledNode ()
 
void isCurrentlyEnabledInit (std::string _device)
 
const char * getTravelrangeNode ()
 
const char * getTransformationNode ()
 
void getTransformationInit (std::string _unit, std::string _coordinate_system)
 
const char * moveToNode ()
 
void moveToInit (const Nice::MapStringPoint &_positions, std::string _unit, std::string _coordinate_system)
 
const char * retreatToBaseNode ()
 
void retreatToBaseInit (const Nice::MapStringPoint &_positions)
 
const char * moveByNode ()
 
void moveByInit (const Nice::MapStringPoint &_distance, std::string _unit, std::string _coordinate_system)
 
const char * moveToHomeNode ()
 
const char * validateMoveToNode ()
 
void validateMoveToInit (const Nice::MapStringPoint &_positions, std::string _unit, std::string _coordinate_system)
 
const char * validateMoveByNode ()
 
void validateMoveByInit (const Nice::MapStringPoint &_distance, std::string _unit, std::string _coordinate_system)
 
const char * setEnabledDeviceNode ()
 
void setEnabledDeviceInit (std::string _device, bool _enable, const Nice::Point &_position)
 
const char * setEnabledDevicesNode ()
 
void setEnabledDevicesInit (const Nice::MapStringPoint &_positions, Nice::DynamicBitset _enable)
 
virtual void work ()
 
- Protected Member Functions inherited from Basda::ServiceWorkerSkeleton
 ServiceWorkerSkeleton (const Nice::JointPtr &_config)
 
 ServiceWorkerSkeleton (const Nice::JointPtr &_config)
 
- Protected Member Functions inherited from Basda::ServiceWorker
 ServiceWorker (const Nice::JointPtr &_jointPtr)
 ctor More...
 
virtual ~ServiceWorker ()
 dtor Does nothing (in this base class) More...
 
void triggerState (const Basda::ServiceStateMachine &_state)
 change state to a new state More...
 
void sendStateStatus (const std::string &_action, int _percent)
 
void setState (Basda::ServiceState _next)
 
virtual void waitForNewState ()
 
virtual bool timedWaitForNewState (const Nice::Time &_timeout)
 
virtual void preinit ()
 
virtual void packin ()
 schedule ONLINE as the next target state. More...
 
virtual void idleStandby ()
 wait for a state change. More...
 
 ServiceWorker (const Nice::JointPtr &_jointPtr)
 
virtual ~ServiceWorker ()
 
void triggerState (const Basda::ServiceStateMachine &_state)
 
void sendStateStatus (const std::string &_action, int _percent)
 
void setState (Basda::ServiceState _next)
 
virtual void waitForNewState ()
 
virtual bool timedWaitForNewState (const Nice::Time &_timeout)
 
virtual void preinit ()
 
virtual void packin ()
 
virtual void idleStandby ()
 

Protected Attributes

DeviceAsyncImpl m_deviceAsync
 the call back object for the devices More...
 
DeviceCmdAsyncImpl m_deviceCmdAsync
 the call back object for the devices More...
 
- Protected Attributes inherited from Basda::ServiceWorkerSkeleton
Nice::Completion m_completion
 
Nice::I64 m_id
 
Nice::PropertyPtr m_cmd
 
- Protected Attributes inherited from Basda::ServiceWorker
Nice::JointPtr m_config
 
Nice::PropertyPtr m_state
 
std::string m_name
 

Private Types

typedef std::vector< Basda::ServiceWorkerPtrSeqServiceWorker
 
typedef std::vector< Basda::MoccaNDevicePtrSeqMoccaNDevicePtr
 
typedef std::vector< Basda::ServiceLitePtrSeqServiceLitePtr
 

Private Member Functions

Nice::MapStringPoint validateMove (const Nice::MapStringPoint &_positions, std::string _unit, std::string _coordSys, bool _absolute)
 Check that target positions are reachable and do not lead to collisions. More...
 
void waitForCompletion (std::string _cmd, Basda::DeviceAsync &=Basda::Device::s_async)
 Calculate the completion percent. More...
 
std::string getPythonTraceback ()
 
void updateCardlist ()
 

Private Attributes

Basda::MoccaCDevicePtr m_coconDevice
 
std::map< std::string, Laos::StarEnlargerPtrm_starEnlarger
 
std::map< std::string, Laos::StarEnlargerPtrm_starEnlargerCards
 
boost::python::dict m_starEnlargerNames
 
SeqServiceLitePtr m_overlays
 
std::string m_basicUnit
 
std::string m_basicCoordSys
 
std::string m_defaultUnit
 
std::string m_defaultCoordSys
 
std::map< std::string, int > m_unitNamePrecMap
 
std::string m_notDefined
 
bool m_homeScriptException
 
bool m_coconInitFailed
 

Additional Inherited Members

- Protected Types inherited from Basda::ServiceWorker
typedef void(ServiceWorker::* ServiceWorkerMemFn) ()
 
typedef Branch BranchTable[6][6]
 
typedef IceUtil::Handle< WorkerThreadWorkerThreadPtr
 
typedef void(ServiceWorker::* ServiceWorkerMemFn) ()
 
typedef Branch BranchTable[6][6]
 
typedef IceUtil::Handle< WorkerThreadWorkerThreadPtr
 
- Static Protected Attributes inherited from Basda::ServiceWorker
static BranchTable s_stateTable
 A table which tells which state should go via which intermediate state to a target state. The 6 states are SHUTDOWN, OFFLINE, STANDBY, ONLINE, WORKING and ERROR. The principles are that. More...
 

Member Typedef Documentation

◆ SeqMoccaNDevicePtr

◆ SeqServiceLitePtr

◆ SeqServiceWorker

Constructor & Destructor Documentation

◆ StarEnlargerServiceWorker()

Laos::StarEnlargerServiceWorker::StarEnlargerServiceWorker ( const Nice::JointPtr _config,
Basda::MoccaCDevicePtr  _coconDevice,
std::vector< Basda::MoccaNDevicePtr _moconDevice 
)

◆ ~StarEnlargerServiceWorker()

Laos::StarEnlargerServiceWorker::~StarEnlargerServiceWorker ( )
virtual

Member Function Documentation

◆ abort()

void Laos::StarEnlargerServiceWorker::abort ( void  )
virtual

does nothing.


Reimplemented from Basda::ServiceWorkerSkeleton.

◆ activate()

void Laos::StarEnlargerServiceWorker::activate ( )
virtual

Implements Basda::ServiceWorker.

◆ convertPosition()

Nice::MapStringPoint Laos::StarEnlargerServiceWorker::convertPosition ( const Nice::MapStringPoint _position,
bool  _fromAbsolute,
std::string  _fromUnit,
std::string  _fromCoordSys,
bool  _toAbsolute,
std::string  _toUnit,
std::string  _toCoordSys 
)
virtual

◆ deactivate()

void Laos::StarEnlargerServiceWorker::deactivate ( )
virtual

Implements Basda::ServiceWorker.

◆ deinit()

void Laos::StarEnlargerServiceWorker::deinit ( )
virtual

Implements Basda::ServiceWorker.

◆ errorOffline()

void Laos::StarEnlargerServiceWorker::errorOffline ( )
virtual

set the target state to OFFLINE.


Reimplemented from Basda::ServiceWorker.

◆ errorOnline()

void Laos::StarEnlargerServiceWorker::errorOnline ( )
virtual

set the target state to OFFLINE.


Reimplemented from Basda::ServiceWorker.

◆ errorStandby()

void Laos::StarEnlargerServiceWorker::errorStandby ( )
virtual

set the target state to OFFLINE.


Reimplemented from Basda::ServiceWorker.

◆ errorWorking()

void Laos::StarEnlargerServiceWorker::errorWorking ( )
virtual

set the target state to OFFLINE.


Reimplemented from Basda::ServiceWorker.

◆ getCollision()

void Laos::StarEnlargerServiceWorker::getCollision ( )
virtual

◆ getPosition() [1/2]

Nice::MapStringPoint Laos::StarEnlargerServiceWorker::getPosition ( )
virtual

◆ getPosition() [2/2]

Nice::MapStringPoint Laos::StarEnlargerServiceWorker::getPosition ( std::string  _unit,
std::string  _coordSys,
bool  _devEncoder = true 
)
virtual

◆ getPythonTraceback()

std::string Laos::StarEnlargerServiceWorker::getPythonTraceback ( )
private

◆ getTransformation()

Nice::MapStringWMatrix Laos::StarEnlargerServiceWorker::getTransformation ( std::string  _unit = "UM",
std::string  _coordSys = "F" 
)
virtual

◆ getTravelrange()

Nice::MapStringRect Laos::StarEnlargerServiceWorker::getTravelrange ( )
virtual

◆ identifyMovingMotors()

std::map< std::string, Nice::BitSet > Laos::StarEnlargerServiceWorker::identifyMovingMotors ( Nice::MapStringPoint  _positions,
std::string  _unit,
std::string  _coordSys,
bool  _absolute 
)

◆ idleOffline()

void Laos::StarEnlargerServiceWorker::idleOffline ( )
virtual

wait for a state change.


Reimplemented from Basda::ServiceWorker.

◆ idleOnline()

void Laos::StarEnlargerServiceWorker::idleOnline ( )
virtual

wait for a state change.


Reimplemented from Basda::ServiceWorker.

◆ init()

void Laos::StarEnlargerServiceWorker::init ( )
virtual

Implements Basda::ServiceWorker.

◆ isAtHome()

bool Laos::StarEnlargerServiceWorker::isAtHome ( )
virtual

◆ isAtLimit()

bool Laos::StarEnlargerServiceWorker::isAtLimit ( )
virtual

◆ isCurrentlyEnabled()

bool Laos::StarEnlargerServiceWorker::isCurrentlyEnabled ( std::string  _device)
virtual

◆ isMoving()

bool Laos::StarEnlargerServiceWorker::isMoving ( )
virtual

◆ isReachable()

bool Laos::StarEnlargerServiceWorker::isReachable ( )
virtual

◆ moveBy()

void Laos::StarEnlargerServiceWorker::moveBy ( const Nice::MapStringPoint _distance,
std::string  _unit,
std::string  _coordSys 
)
virtual

◆ moveByStart()

void Laos::StarEnlargerServiceWorker::moveByStart ( std::string  _name,
const Nice::Point _position,
std::string  _unit,
std::string  _coordSys 
)
virtual

Start moving a motor by a relative amount. If the motor is not enabled, it will not be moved.


Parameters
_nameName of the motor to be moved.
_positionThe 2 coordinates of the target position.
_unitUnit string of the coordinates.
_coordSyscoordinate system in which _position is expressed.

python home script command interface

◆ moveByWait()

void Laos::StarEnlargerServiceWorker::moveByWait ( )
virtual

◆ moveTo()

void Laos::StarEnlargerServiceWorker::moveTo ( const Nice::MapStringPoint _positions,
std::string  _unit,
std::string  _coordSys 
)
virtual

◆ moveToHome()

void Laos::StarEnlargerServiceWorker::moveToHome ( )
virtual

◆ moveToHomeSingleStart()

void Laos::StarEnlargerServiceWorker::moveToHomeSingleStart ( std::string  _name,
const int  _motor 
)
virtual

Start moving a motor to its home position. If the motor is not enabled, it will not be moved.


Parameters
_nameThe name of the motor as known in the configuration files. This is just used to figure out whether the motor is enabled, but not which of its coodinates is effected.
_motorThe motor to be moved, by coordinate index. python home script command interface

◆ moveToHomeSingleWait()

void Laos::StarEnlargerServiceWorker::moveToHomeSingleWait ( )
virtual

◆ moveToHomeStart()

void Laos::StarEnlargerServiceWorker::moveToHomeStart ( std::string  _name)
virtual

Start moving a motor to its home position. If the motor is not enabled, it will not be moved.


Parameters
_nameThe name of the motor as known in the configuration files. python home script command interface

◆ moveToHomeWait()

void Laos::StarEnlargerServiceWorker::moveToHomeWait ( )
virtual

◆ moveToLimitStart()

void Laos::StarEnlargerServiceWorker::moveToLimitStart ( std::string  _name,
const Nice::Point _limit 
)
virtual

Start moving a motor to a combined limit in both coordinates. If the motor is not enabled, it will not be moved.


Parameters
_limitThe two positive or negative limit specifications. python home script command interface

◆ moveToLimitWait()

void Laos::StarEnlargerServiceWorker::moveToLimitWait ( )
virtual

◆ moveToStart()

void Laos::StarEnlargerServiceWorker::moveToStart ( std::string  _name,
const Nice::Point _position,
std::string  _unit,
std::string  _coordSys 
)
virtual

Start moving a motor to an absolute position. If the motor is not enabled, it will not be moved.


Parameters
_nameName of the motor to be moved.
_positionThe 2 coordinates of the target position.
_unitUnit string of the coordinates.
_coordSyscoordinate system in which _position is expressed.

python home script command interface

◆ moveToWait()

void Laos::StarEnlargerServiceWorker::moveToWait ( )
virtual

◆ predict()

void Laos::StarEnlargerServiceWorker::predict ( )
protected

predict the time to reach the target positions and detect collisions.


Exceptions
SECollisionExceptionif some SE would touch while moving to the target position.

◆ resetCollision()

void Laos::StarEnlargerServiceWorker::resetCollision ( )
virtual

◆ retreatToBase()

void Laos::StarEnlargerServiceWorker::retreatToBase ( const Nice::MapStringPoint _positions)
virtual

Move the y-positions of all devices in the _positions to zero. Effectively this retreats all motors to their base positions, keeping the x component and minimizing the amount the individual motors stick into the common area. The implementation is serialized, which means, the motors move individually in the order detailed in the _positions, and the next motor moves once the previous motor has settled to its base position.


The standard use is starting the SE positioning after a preset and after derotation started, where some of the SE are selected to move to new positions; all others (to be used here) should first move their y-motors to their bases, before the others are moved to their new destinations.

Parameters
_positionsThe list of the motors to be moved. The actual positions (Points) in that list are not much relevant.
Since
2017-07-02
Author
R. J. Mathar

Implements Laos::StarEnlargerServiceWorkerSkeleton.

◆ setCollision()

void Laos::StarEnlargerServiceWorker::setCollision ( )
virtual

◆ setEnabledDevice()

void Laos::StarEnlargerServiceWorker::setEnabledDevice ( std::string  _device,
bool  _enable,
const Nice::Point _position 
)
virtual

◆ setEnabledDevices()

void Laos::StarEnlargerServiceWorker::setEnabledDevices ( const Nice::MapStringPoint _positions,
Nice::DynamicBitset  _enable 
)
virtual

◆ setPosition()

void Laos::StarEnlargerServiceWorker::setPosition ( std::string  _name,
const Nice::Point _position 
)
virtual

◆ setTargets()

void Laos::StarEnlargerServiceWorker::setTargets ( const Nice::MapStringPoint _targetPositions)
virtual

This is a conversion method. The service itself does not have units.

Implements Laos::StarEnlargerServiceWorkerSkeleton.

◆ status()

void Laos::StarEnlargerServiceWorker::status ( )
protectedvirtual

◆ stop()

void Laos::StarEnlargerServiceWorker::stop ( )
virtual

does nothing.


Reimplemented from Basda::ServiceWorkerSkeleton.

◆ terminate()

void Laos::StarEnlargerServiceWorker::terminate ( )
virtual

schedule EXIT as the next target state.


Reimplemented from Basda::ServiceWorker.

◆ updateCardlist()

void Laos::StarEnlargerServiceWorker::updateCardlist ( )
private

◆ validateMove()

Nice::MapStringPoint Laos::StarEnlargerServiceWorker::validateMove ( const Nice::MapStringPoint _positions,
std::string  _unit,
std::string  _coordSys,
bool  _absolute 
)
private

Check that target positions are reachable and do not lead to collisions.


Parameters
_positionsThe mangled map of names SE01, SE02 and so on as keys and the Nice::Point as second values.
_unit"UM" for microns.
_coordSys"F" for the focal plane system.
_absoluteTrue if the positions are absolute inthe coordinate system, not relative to the current positions.

◆ validateMoveBy()

bool Laos::StarEnlargerServiceWorker::validateMoveBy ( const Nice::MapStringPoint _distance,
std::string  _unit,
std::string  _coordSys 
)
virtual

◆ validateMoveTo()

bool Laos::StarEnlargerServiceWorker::validateMoveTo ( const Nice::MapStringPoint _positions,
std::string  _unit,
std::string  _coordSys 
)
virtual

◆ waitForCompletion()

void Laos::StarEnlargerServiceWorker::waitForCompletion ( 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

Member Data Documentation

◆ m_basicCoordSys

std::string Laos::StarEnlargerServiceWorker::m_basicCoordSys
private

◆ m_basicUnit

std::string Laos::StarEnlargerServiceWorker::m_basicUnit
private

◆ m_coconDevice

Basda::MoccaCDevicePtr Laos::StarEnlargerServiceWorker::m_coconDevice
private

◆ m_coconInitFailed

bool Laos::StarEnlargerServiceWorker::m_coconInitFailed
private

◆ m_defaultCoordSys

std::string Laos::StarEnlargerServiceWorker::m_defaultCoordSys
private

◆ m_defaultUnit

std::string Laos::StarEnlargerServiceWorker::m_defaultUnit
private

◆ m_deviceAsync

DeviceAsyncImpl Laos::StarEnlargerServiceWorker::m_deviceAsync
protected

the call back object for the devices

◆ m_deviceCmdAsync

DeviceCmdAsyncImpl Laos::StarEnlargerServiceWorker::m_deviceCmdAsync
protected

the call back object for the devices

◆ m_homeScriptException

bool Laos::StarEnlargerServiceWorker::m_homeScriptException
private

◆ m_notDefined

std::string Laos::StarEnlargerServiceWorker::m_notDefined
private

◆ m_overlays

SeqServiceLitePtr Laos::StarEnlargerServiceWorker::m_overlays
private

◆ m_starEnlarger

std::map<std::string, Laos::StarEnlargerPtr> Laos::StarEnlargerServiceWorker::m_starEnlarger
private

◆ m_starEnlargerCards

std::map<std::string, Laos::StarEnlargerPtr> Laos::StarEnlargerServiceWorker::m_starEnlargerCards
private

◆ m_starEnlargerNames

boost::python::dict Laos::StarEnlargerServiceWorker::m_starEnlargerNames
private

◆ m_unitNamePrecMap

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

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