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

#include <LaosDrotServiceWorker.h>

Inheritance diagram for Laos::DrotServiceWorker:
Inheritance graph
Collaboration diagram for Laos::DrotServiceWorker:
Collaboration graph

Public Member Functions

 DrotServiceWorker (const Nice::JointPtr &_config, const Basda::MoccaNDevicePtr &_device)
 ctor More...
 
virtual ~DrotServiceWorker ()
 dtor Removes bridges that have been created by the ctor. More...
 
virtual void init ()
 This method initiate and open the interface. More...
 
virtual void idleOnline ()
 
virtual void changeDerotationWithAbsoluteOffset (const Nice::Date &_startPositionAbsolute, double _startPosition, std::string _unit)
 
virtual void changeDerotationWithRelativeOffset (const Nice::Date &_startPositionRelative, double _startPosition, std::string _unit)
 Change the trajectory at some time in the future by a relative amount. More...
 
virtual Nice::SeqPoint getKFPCoordinates ()
 
virtual lbto::SeqPos2 getPresetStars ()
 
bool isSlewing ()
 
bool isRotating ()
 
virtual std::string getLINCstation ()
 
virtual double getParallacticAngle ()
 
virtual void startDerotation (const Nice::Date &_startDate, double _startPosition, std::string _unit)
 Get polynomials from the TCS, move to start position, and start the derotator motion. More...
 
virtual void startTimedDerotation (const Nice::Date &_startDate, double _startPosition, Nice::Time _durat, std::string _unit)
 Get polynomials from the TCS, move to start position, and start the derotator motion. More...
 
virtual void startDerotationHere (const Nice::Date &_startDate)
 Get polynomials from the TCS and start the derotator motion. The difference to startDerotation() is that this function does not move the motor to any particular position but starts from where it is. The function is not overloading startDerotation() because this allows to have them both exposed to the Basda/ICE interface. More...
 
virtual void rewind (Nice::Time _durat, bool _go, Nice::Time _delay)
 Move to the position where the previous derotation started and restart derotation. More...
 
virtual double convertPosition (double _position, bool _absolute, std::string _unitFrom, std::string _unitTo)
 
virtual void transformationFactorChanged (const Nice::Any &_a)
 called automatically whenever the transformation property has changed. More...
 
virtual double coordinateTransformation (double _value, std::string _unit)
 This method converts the given absolute value from steps into _unit. Thereby it uses dx to add the coordinate system offset. More...
 
virtual double coordinateTransformationInverse (double _value, std::string _unit)
 Converts the given absolute value from _unit into steps. More...
 
virtual double coordinateTranslateInverse (double _value, std::string _unit)
 Convert the given value from _unit into steps. Thereby it ignores the coordinate system offset dx. More...
 
virtual double coordinateTranslate (double _value, std::string _unit)
 Convert the given value from steps into _unit. Thereby it ignores the coordinate system offset dx. More...
 
virtual std::string getRA ()
 ask the LN proxy IIF server for the right ascension. More...
 
Nice::Time timeLeft ()
 Get an estimate of the time that is left on the trajectory. More...
 
Nice::Time timeLeft (int frequency, double _startPosition, std::string _unit, bool trunc)
 Get an estimate of the time that is left on the trajectory till hitting the limit switch. More...
 
 DrotServiceWorker (const Nice::JointPtr &_config, const Basda::MoccaNDevicePtr &_device)
 
virtual ~DrotServiceWorker ()
 
virtual void init ()
 This method initiate and open the interface. More...
 
virtual void idleOnline ()
 
virtual void changeDerotationWithAbsoluteOffset (const Nice::Date &_startPositionAbsolute, double _startPosition, std::string _unit)
 
virtual void changeDerotationWithRelativeOffset (const Nice::Date &_startPositionRelative, double _startPosition, std::string _unit)
 
virtual Nice::SeqPoint getKFPCoordinates ()
 
virtual lbto::SeqPos2 getPresetStars ()
 
bool isSlewing ()
 
bool isRotating ()
 
virtual std::string getLINCstation ()
 
virtual double getParallacticAngle ()
 
virtual void startDerotation (const Nice::Date &_startDate, double _startPosition, std::string _unit)
 
virtual void startTimedDerotation (const Nice::Date &_startDate, double _startPosition, Nice::Time _durat, std::string _unit)
 
virtual void startDerotationHere (const Nice::Date &_startDate)
 
virtual void rewind (Nice::Time _durat, bool _go, Nice::Time _delay)
 
virtual double convertPosition (double _position, bool _absolute, std::string _unitFrom, std::string _unitTo)
 
virtual void transformationFactorChanged (const Nice::Any &_a)
 
virtual double coordinateTransformation (double _value, std::string _unit)
 This method converts the given value from steps into _unit. More...
 
virtual double coordinateTransformationInverse (double _value, std::string _unit)
 This method converts the given value from _unit into steps. More...
 
virtual double coordinateTranslateInverse (double _value, std::string _unit)
 This method converts the given value from _unit into steps. More...
 
virtual double coordinateTranslate (double _value, std::string _unit)
 
virtual std::string getRA ()
 
Nice::Time timeLeft ()
 
Nice::Time timeLeft (int frequency, double _startPosition, std::string _unit, bool trunc)
 
- Public Member Functions inherited from Basda::MoccaNServiceWorkerCore< double, double, Nice::Point, DrotServiceWorkerSkeleton >
 MoccaNServiceWorkerCore (const Nice::JointPtr &_config, const MoccaNDevicePtr &_device)
 Constructor. More...
 
 MoccaNServiceWorkerCore (const Nice::JointPtr &_config, const MoccaNDevicePtr &_device)
 Constructor. More...
 
 MoccaNServiceWorkerCore (const Nice::JointPtr &_config, const MoccaNDevicePtr &_device)
 Constructor. More...
 
virtual ~MoccaNServiceWorkerCore ()
 Destructor. More...
 
virtual ~MoccaNServiceWorkerCore ()
 Destructor. More...
 
virtual ~MoccaNServiceWorkerCore ()
 Destructor. More...
 
virtual void deinit ()
 This method deinit and close the device. More...
 
virtual void deinit ()
 This method deinit and close the device. More...
 
virtual void deinit ()
 This method deinit and close the device. More...
 
virtual void activate ()
 This method activate the device. More...
 
virtual void activate ()
 This method activate the device. More...
 
virtual void activate ()
 This method activate the device. More...
 
virtual void deactivate ()
 This method deactivate the device. More...
 
virtual void deactivate ()
 This method deactivate the device. More...
 
virtual void deactivate ()
 This method deactivate the device. More...
 
virtual void terminate ()
 This method shut down the device. More...
 
virtual void terminate ()
 This method shut down the device. More...
 
virtual void terminate ()
 This method shut down the device. More...
 
virtual void errorOffline ()
 
virtual void errorOffline ()
 
virtual void errorOffline ()
 
virtual void errorStandby ()
 
virtual void errorStandby ()
 
virtual void errorStandby ()
 
virtual void errorOnline ()
 
virtual void errorOnline ()
 
virtual void errorOnline ()
 
virtual void errorWorking ()
 
virtual void errorWorking ()
 
virtual void errorWorking ()
 
virtual void idleOffline ()
 
virtual void idleOffline ()
 
virtual void idleOffline ()
 
virtual void send (std::string _cardNo, std::string _commandID, std::string _moduleNo, std::string _selectID, std::string _parameter, std::string _numberOfLines)
 This method send the command string to the electronic. More...
 
virtual void send (std::string _cardNo, std::string _commandID, std::string _moduleNo, std::string _selectID, std::string _parameter, std::string _numberOfLines)
 This method send the command string to the electronic. More...
 
virtual void send (std::string _cardNo, std::string _commandID, std::string _moduleNo, std::string _selectID, std::string _parameter, std::string _numberOfLines)
 This method send the command string to the electronic. More...
 
virtual std::string receive ()
 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 receive ()
 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 receive ()
 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)
 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)
 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)
 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 bool isReachable ()
 
virtual bool isReachable ()
 
virtual bool isReachable ()
 
virtual void dumpStatusInformation ()
 
virtual void dumpStatusInformation ()
 
virtual void dumpStatusInformation ()
 
virtual void stop ()
 This method stop all moving motors smoothly. More...
 
virtual void stop ()
 This method stop all moving motors smoothly. More...
 
virtual void stop ()
 This method stop all moving motors smoothly. More...
 
virtual void abort ()
 This method abort all moving motors immediately. More...
 
virtual void abort ()
 This method abort all moving motors immediately. More...
 
virtual void abort ()
 This method abort all moving motors immediately. More...
 
virtual void moveAbsolute (IfSvcType _pos, std::string _unit)
 All motors of a device move to the absolute position. More...
 
virtual void moveAbsolute (IfSvcType _pos, std::string _unit)
 All motors of a device move to the absolute position. More...
 
virtual void moveAbsolute (IfSvcType _pos, std::string _unit)
 All motors of a device move to the absolute position. More...
 
virtual void moveRelative (IfSvcType _pos, std::string _unit)
 All motors of a device move to the relative position. More...
 
virtual void moveRelative (IfSvcType _pos, std::string _unit)
 All motors of a device move to the relative position. More...
 
virtual void moveRelative (IfSvcType _pos, std::string _unit)
 All motors of a device move to the relative position. More...
 
virtual void moveToHome ()
 All motors of the device are looking for the reference positions and reset the step counter to zero. More...
 
virtual void moveToHome ()
 All motors of the device are looking for the reference positions and reset the step counter to zero. More...
 
virtual void moveToHome ()
 All motors of the device are looking for the reference positions and reset the step counter to zero. More...
 
virtual void moveToHomeSingle (int _motor)
 
virtual void moveToHomeSingle (int _motor)
 
virtual void moveToHomeSingle (int _motor)
 
virtual void moveToLimit (IfSvcType _limit)
 move all motors to the positive limit switches (_limits[i]>0) or negative (_limits[i]<0) limit switches. More...
 
virtual void moveToLimit (IfSvcType _limit)
 move all motors to the positive limit switches (_limits[i]>0) or negative (_limits[i]<0) limit switches. More...
 
virtual void moveToLimit (IfSvcType _limit)
 move all motors to the positive limit switches (_limits[i]>0) or negative (_limits[i]<0) limit switches. More...
 
virtual void moveToNamedPosition (int _namedPosition)
 This method allows to move the motor to a named position. More...
 
virtual void moveToNamedPosition (int _namedPosition)
 This method allows to move the motor to a named position. More...
 
virtual void moveToNamedPosition (int _namedPosition)
 This method allows to move the motor to a named position. More...
 
virtual bool isAtHome ()
 This method updates the property VAR.ATHOME which indicates whether the motor is at the home position. More...
 
virtual bool isAtHome ()
 This method updates the property VAR.ATHOME which indicates whether the motor is at the home position. More...
 
virtual bool isAtHome ()
 This method updates the property VAR.ATHOME which indicates whether the motor is at the home position. More...
 
virtual bool isAtLimit ()
 This method updates the property VAR.LIMIT which indicates whether the motor is at the limit position. More...
 
virtual bool isAtLimit ()
 This method updates the property VAR.LIMIT which indicates whether the motor is at the limit position. More...
 
virtual bool isAtLimit ()
 This method updates the property VAR.LIMIT which indicates whether the motor is at the limit position. More...
 
virtual bool isMoving ()
 This method updates the property VAR.MOVING which indicates whether the motor is moving. More...
 
virtual bool isMoving ()
 This method updates the property VAR.MOVING which indicates whether the motor is moving. More...
 
virtual bool isMoving ()
 This method updates the property VAR.MOVING which indicates whether the motor is moving. More...
 
virtual double getPosition ()
 Returns the current positions of all motors. More...
 
virtual double getPosition (std::string _unit)
 
virtual double getPosition ()
 Returns the current positions of all motors. More...
 
virtual double getPosition (std::string _unit)
 
virtual double getPosition ()
 Returns the current positions of all motors. More...
 
virtual double getPosition (std::string _unit)
 
virtual double getDeviceEncoderPosition (std::string _unit)
 Returns the current device internal position encoder of all motors. More...
 
virtual double getDeviceEncoderPosition (std::string _unit)
 Returns the current device internal position encoder of all motors. More...
 
virtual double getDeviceEncoderPosition (std::string _unit)
 Returns the current device internal position encoder of all motors. More...
 
virtual double getAbsoluteEncoderPosition ()
 Returns the current absolute encoder positions of all motors. More...
 
virtual double getAbsoluteEncoderPosition ()
 Returns the current absolute encoder positions of all motors. More...
 
virtual double getAbsoluteEncoderPosition ()
 Returns the current absolute encoder positions of all motors. More...
 
virtual double getIncrementalEncoderPosition ()
 Returns the current incremental encoder positions of all motors. More...
 
virtual double getIncrementalEncoderPosition ()
 Returns the current incremental encoder positions of all motors. More...
 
virtual double getIncrementalEncoderPosition ()
 Returns the current incremental encoder positions of all motors. More...
 
virtual void setPosition (IfSvcType _position, std::string _unit)
 Change the absolute position of all motors. More...
 
virtual void setPosition (IfSvcType _position, std::string _unit)
 Change the absolute position of all motors. More...
 
virtual void setPosition (IfSvcType _position, std::string _unit)
 Change the absolute position of all motors. More...
 
virtual double getNamedPosition (int _reference)
 This method returns the value of the named position. More...
 
virtual double getNamedPosition (int _reference)
 This method returns the value of the named position. More...
 
virtual double getNamedPosition (int _reference)
 This method returns the value of the named position. More...
 
virtual std::string checkForNamedPosition ()
 This method checks whether the current position is a named position. More...
 
virtual std::string checkForNamedPosition ()
 This method checks whether the current position is a named position. More...
 
virtual std::string checkForNamedPosition ()
 This method checks whether the current position is a named position. More...
 
virtual double getVelocity ()
 This method read the velocity of the device. More...
 
virtual double getVelocity ()
 This method read the velocity of the device. More...
 
virtual double getVelocity ()
 This method read the velocity of the device. More...
 
virtual void setVelocity (IfDevType _velocity)
 This method set the velocity in the device. More...
 
virtual void setVelocity (IfDevType _velocity)
 This method set the velocity in the device. More...
 
virtual void setVelocity (IfDevType _velocity)
 This method set the velocity in the device. More...
 
virtual double getCurrentTime ()
 
virtual double getCurrentTime ()
 
virtual double getCurrentTime ()
 
virtual Nice::SeqBitSet getPositionSwitchStatus ()
 : This method returns the current position switch status. More...
 
virtual Nice::SeqBitSet getPositionSwitchStatus ()
 : This method returns the current position switch status. More...
 
virtual Nice::SeqBitSet getPositionSwitchStatus ()
 : This method returns the current position switch status. More...
 
virtual void startProfile (const Nice::Date &, const Nice::NPoint &, Nice::Time, Nice::U32, Nice::U32)
 This method prepare the motor controller with a new external profile. More...
 
virtual void startProfile (const Nice::Date &, const Nice::NPoint &, Nice::Time, Nice::U32, Nice::U32)
 This method prepare the motor controller with a new external profile. More...
 
virtual void startProfile (const Nice::Date &, const Nice::NPoint &, Nice::Time, Nice::U32, Nice::U32)
 This method prepare the motor controller with a new external profile. More...
 
virtual void changeProfile (const Nice::Date &, const Nice::NPoint &)
 
virtual void changeProfile (const Nice::Date &, const Nice::NPoint &)
 
virtual void changeProfile (const Nice::Date &, const Nice::NPoint &)
 

Private Member Functions

void createTrajectory (const Nice::Date &_startDate)
 Get IIF rotator polynomials and convert them to MoCon steps. Note that the entire calculation is unaware of a start position (in steps). So the trajectory is starting (virtually) at step 0. It is left to getReady() to change the steps into absolute steps for the MoCon. The number of polynomials (which implies a duration) is obtained from the configuration file. More...
 
void createTrajectory (const Nice::Date &_startDate, Nice::Time _durat)
 Get IIF rotator polynomials and convert them to MoCon steps. Note that the entire calculation is unaware of a start position (in steps). So the trajectory is starting (virtually) at step 0. It is left to getReady() to change the steps into absolute steps for the MoCon. More...
 
void getReady (double _startPosition, std::string _unit)
 Move to the start/initial position of the rotator trajectory. Also convert the relative positions in m_positionSequence to absolute positions. More...
 
void createTrajectory (const Nice::Date &_startDate)
 
void createTrajectory (const Nice::Date &_startDate, Nice::Time _durat)
 
void getReady (double _startPosition, std::string _unit)
 

Private Attributes

Ltcs::IifServiceWorkerInterfacePtr m_iif
 the interface to ask the IIF for derotator polynomials or parallactic angle. More...
 
Nice::MapStringPoint m_transformation
 A vector with the coordinate transformation values. More...
 
Nice::Date m_startDate
 projected start time of the derotator polynomial More...
 
double m_samplingRate
 Time interval for the duration of one derotator polynomial (seconds) More...
 
int m_numberOfPolynomials
 Number of polynomial slices from the IIF. More...
 
double m_stepsPerRad
 number of motor steps to rotate by one radian More...
 
double m_stepsPerDegree
 number of motor steps to rotate by one degree More...
 
double m_ang_rad
 accumulated angle since trajectory start in radian More...
 
double m_ang_steps
 accumulated angle since trajectory start in steps More...
 
float m_direction
 direction of motor steps relative to derotator polynomials. More...
 
Nice::Point m_trange
 The configured travel range (steps) More...
 
Nice::NPoint m_positionSequence
 
Nice::JointPtr m_resolutionProperty
 

Additional Inherited Members

- Protected Member Functions inherited from Basda::MoccaNServiceWorkerCore< double, double, Nice::Point, DrotServiceWorkerSkeleton >
virtual void status ()
 The method calls different commands in order to update the status. More...
 
virtual void status ()
 The method calls different commands in order to update the status. More...
 
virtual void status ()
 The method calls different commands in order to update the status. More...
 
virtual DeviceAsyncImpldeviceAsyncImpl ()
 
virtual DeviceAsyncImpldeviceAsyncImpl ()
 
virtual DeviceAsyncImpldeviceAsyncImpl ()
 
virtual DeviceAsyncImpldeviceCmdAsyncImpl ()
 
virtual DeviceAsyncImpldeviceCmdAsyncImpl ()
 
virtual DeviceAsyncImpldeviceCmdAsyncImpl ()
 
Nice::Point getDefaultTransformation ()
 Compose the unit transformation. More...
 
Nice::Point getDefaultTransformation ()
 
Nice::Point getDefaultTransformation ()
 Compose the unit transformation. More...
 
Nice::Point getDefaultTransformation ()
 
Nice::Point getDefaultTransformation ()
 
Nice::Point getDefaultTransformation ()
 
Nice::Point getDefaultTransformation ()
 
Nice::Point getDefaultTransformation ()
 
Nice::WMatrix getDefaultTransformation ()
 
Nice::WMatrix getDefaultTransformation ()
 
Nice::W3Matrix getDefaultTransformation ()
 
Nice::W3Matrix getDefaultTransformation ()
 
Nice::Point getDefaultTransformation ()
 
Nice::Point getDefaultTransformation ()
 
Nice::Point getDefaultTransformation ()
 
Nice::Point getDefaultTransformation ()
 
Nice::W3Matrix getDefaultTransformation ()
 
Nice::W3Matrix getDefaultTransformation ()
 
Nice::Point getDefaultTransformation ()
 
Nice::Point getDefaultTransformation ()
 
Nice::Point getDefaultTransformation ()
 
Nice::Point getDefaultTransformation ()
 
Nice::WMatrix getDefaultTransformation ()
 
Nice::WMatrix getDefaultTransformation ()
 
- Static Protected Member Functions inherited from Basda::MoccaNServiceWorkerCore< double, double, Nice::Point, DrotServiceWorkerSkeleton >
static Nice::Point getDefaultTransformation ()
 
static Nice::Point getDefaultTransformation ()
 
static Nice::Point getDefaultTransformation ()
 
- Protected Attributes inherited from Basda::MoccaNServiceWorkerCore< double, double, Nice::Point, DrotServiceWorkerSkeleton >
MoccaNDevicePtr m_device
 the object to call the xy device More...
 
DeviceAsyncImpl m_deviceAsync
 the master object ???? More...
 
DeviceCmdAsyncImpl m_deviceCmdAsync
 the call back object for the devices More...
 
SeqString m_namedPosAbsNameString
 
std::map< std::string, int > m_unitNamePrecMap
 
std::string m_basicUnit
 
int m_numberOfUnits
 
bool m_stopProfile
 
Nice::Time m_delay
 
Nice::Time m_delayDefault
 

Detailed Description

Since
2014-08-22
Author
kittmann

Constructor & Destructor Documentation

◆ DrotServiceWorker() [1/2]

Laos::DrotServiceWorker::DrotServiceWorker ( const Nice::JointPtr _config,
const Basda::MoccaNDevicePtr _device 
)

ctor


Parameters
_config
_device

◆ ~DrotServiceWorker() [1/2]

Laos::DrotServiceWorker::~DrotServiceWorker ( )
virtual

dtor Removes bridges that have been created by the ctor.


◆ DrotServiceWorker() [2/2]

Laos::DrotServiceWorker::DrotServiceWorker ( const Nice::JointPtr _config,
const Basda::MoccaNDevicePtr _device 
)

◆ ~DrotServiceWorker() [2/2]

virtual Laos::DrotServiceWorker::~DrotServiceWorker ( )
virtual

Member Function Documentation

◆ changeDerotationWithAbsoluteOffset() [1/2]

void Laos::DrotServiceWorker::changeDerotationWithAbsoluteOffset ( const Nice::Date _startDate,
double  _startPositionAbsolute,
std::string  _unit 
)
virtual

Parameters
_startDateTime in the future when the new segment should start.
_startPositionAbsolutePosition at which the new segment should start.
_unitThe unit in which _startPosition is expressed.

◆ changeDerotationWithAbsoluteOffset() [2/2]

virtual void Laos::DrotServiceWorker::changeDerotationWithAbsoluteOffset ( const Nice::Date _startPositionAbsolute,
double  _startPosition,
std::string  _unit 
)
virtual

◆ changeDerotationWithRelativeOffset() [1/2]

virtual void Laos::DrotServiceWorker::changeDerotationWithRelativeOffset ( const Nice::Date _startPositionRelative,
double  _startPosition,
std::string  _unit 
)
virtual

◆ changeDerotationWithRelativeOffset() [2/2]

void Laos::DrotServiceWorker::changeDerotationWithRelativeOffset ( const Nice::Date _startDate,
double  _startPositionRelative,
std::string  _unit 
)
virtual

Change the trajectory at some time in the future by a relative amount.


Parameters
_startDateThe time in the future (when the old trajectory is still alive)
_startPositionRelativeThe kink to the trajectory at the time.
_unitThe units to interpret _startPositionRelative .

◆ convertPosition() [1/2]

double Laos::DrotServiceWorker::convertPosition ( double  _position,
bool  _absolute,
std::string  _unitFrom,
std::string  _unitTo 
)
virtual

Parameters
_position
_absoluteIf true the _position is in absolute units
_unitFrom
_unitTo

◆ convertPosition() [2/2]

virtual double Laos::DrotServiceWorker::convertPosition ( double  _position,
bool  _absolute,
std::string  _unitFrom,
std::string  _unitTo 
)
virtual

◆ coordinateTransformation() [1/2]

double Laos::DrotServiceWorker::coordinateTransformation ( double  _value,
std::string  _unit 
)
virtual

This method converts the given absolute value from steps into _unit. Thereby it uses dx to add the coordinate system offset.


The given value (in steps) will be converted in _unit based on the specified coordinate transformation.

Parameters
_valuethe position value (in steps) which has to be converted
_unitthe target unit
Returns
the absolute position in _unit

Implements Basda::MoccaNServiceWorkerCore< double, double, Nice::Point, DrotServiceWorkerSkeleton >.

◆ coordinateTransformation() [2/2]

virtual double Laos::DrotServiceWorker::coordinateTransformation ( double  _value,
std::string  _unit 
)
virtual

This method converts the given value from steps into _unit.

The given value (in steps) will be converted in _unit based on the specified coordinate transformation.

Parameters
_valuethe position value (in steps) which has to be converted
_unitthe target unit
Returns
the absolute position in _unit

Implements Basda::MoccaNServiceWorkerCore< double, double, Nice::Point, DrotServiceWorkerSkeleton >.

◆ coordinateTransformationInverse() [1/2]

double Laos::DrotServiceWorker::coordinateTransformationInverse ( double  _value,
std::string  _unit 
)
virtual

Converts the given absolute value from _unit into steps.


Thereby it uses dx to subtract the coordinate system offset.

The given value will be converted in steps based on _unit and the specified coordinate transformation.

Parameters
_valuethe position value which has to be converted
_unitthe current unit of _value
theabsolute position in steps

Implements Basda::MoccaNServiceWorkerCore< double, double, Nice::Point, DrotServiceWorkerSkeleton >.

◆ coordinateTransformationInverse() [2/2]

virtual double Laos::DrotServiceWorker::coordinateTransformationInverse ( double  _value,
std::string  _unit 
)
virtual

This method converts the given value from _unit into steps.

The given value will be converted in steps based on _unit and the specified coordinate transformation.

Parameters
_valuethe position value which has to be converted
_unitthe current unit of _value
theabsolute position in steps

Implements Basda::MoccaNServiceWorkerCore< double, double, Nice::Point, DrotServiceWorkerSkeleton >.

◆ coordinateTranslate() [1/2]

double Laos::DrotServiceWorker::coordinateTranslate ( double  _value,
std::string  _unit 
)
virtual

Convert the given value from steps into _unit. Thereby it ignores the coordinate system offset dx.


Parameters
_valuethe relative position value which has to be converted
_unitthe unit in which the value has to be converted
Returns
the relative position value in _unit

◆ coordinateTranslate() [2/2]

virtual double Laos::DrotServiceWorker::coordinateTranslate ( double  _value,
std::string  _unit 
)
virtual

◆ coordinateTranslateInverse() [1/2]

double Laos::DrotServiceWorker::coordinateTranslateInverse ( double  _value,
std::string  _unit 
)
virtual

Convert the given value from _unit into steps. Thereby it ignores the coordinate system offset dx.


Parameters
_valuethe relative position value which has to be converted
_unitthe current unit of _value
Returns
the relative position in steps

Implements Basda::MoccaNServiceWorkerCore< double, double, Nice::Point, DrotServiceWorkerSkeleton >.

◆ coordinateTranslateInverse() [2/2]

virtual double Laos::DrotServiceWorker::coordinateTranslateInverse ( double  _value,
std::string  _unit 
)
virtual

This method converts the given value from _unit into steps.

Thereby it ignores the coordinate system offset dx.

Parameters
_valuethe relative position value which has to be converted
_unitthe current unit of _value
Returns
the relative position in steps

Implements Basda::MoccaNServiceWorkerCore< double, double, Nice::Point, DrotServiceWorkerSkeleton >.

◆ createTrajectory() [1/4]

void Laos::DrotServiceWorker::createTrajectory ( const Nice::Date _startDate)
private

◆ createTrajectory() [2/4]

void Laos::DrotServiceWorker::createTrajectory ( const Nice::Date _startDate)
private

Get IIF rotator polynomials and convert them to MoCon steps. Note that the entire calculation is unaware of a start position (in steps). So the trajectory is starting (virtually) at step 0. It is left to getReady() to change the steps into absolute steps for the MoCon. The number of polynomials (which implies a duration) is obtained from the configuration file.


Parameters
_startDateDatum of the start of the trajectory (in the future)

◆ createTrajectory() [3/4]

void Laos::DrotServiceWorker::createTrajectory ( const Nice::Date _startDate,
Nice::Time  _durat 
)
private

Get IIF rotator polynomials and convert them to MoCon steps. Note that the entire calculation is unaware of a start position (in steps). So the trajectory is starting (virtually) at step 0. It is left to getReady() to change the steps into absolute steps for the MoCon.


Parameters
_startDateDatum of the start of the trajectory (in the future)
_duratDuration of the trajectory. This overrides the (quasi-fixed) number of polynomials of the config file.
Since
2018-12-04
Todo:
don't accept unreasonable _durat values (say smaller than a few seconds or longer than some hours)

Parameters
_startDateDatum of the start of the trajectory (in the future)
_duratDuration of the trajectory. This overrides the (quasi-fixed) number of polynomials of the config file.
Since
2018-12-04
Todo:
don't accept unreasonable _durat values (say smaller than a few seconds or longer than some hours)

◆ createTrajectory() [4/4]

void Laos::DrotServiceWorker::createTrajectory ( const Nice::Date _startDate,
Nice::Time  _durat 
)
private

◆ getKFPCoordinates() [1/2]

virtual Nice::SeqPoint Laos::DrotServiceWorker::getKFPCoordinates ( )
virtual

◆ getKFPCoordinates() [2/2]

Nice::SeqPoint Laos::DrotServiceWorker::getKFPCoordinates ( )
virtual

◆ getLINCstation() [1/2]

virtual std::string Laos::DrotServiceWorker::getLINCstation ( )
virtual

◆ getLINCstation() [2/2]

std::string Laos::DrotServiceWorker::getLINCstation ( )
virtual

◆ getParallacticAngle() [1/2]

double Laos::DrotServiceWorker::getParallacticAngle ( )
virtual

◆ getParallacticAngle() [2/2]

virtual double Laos::DrotServiceWorker::getParallacticAngle ( )
virtual

◆ getPresetStars() [1/2]

virtual lbto::SeqPos2 Laos::DrotServiceWorker::getPresetStars ( )
virtual

◆ getPresetStars() [2/2]

lbto::SeqPos2 Laos::DrotServiceWorker::getPresetStars ( )
virtual

◆ getRA() [1/2]

std::string Laos::DrotServiceWorker::getRA ( )
virtual

ask the LN proxy IIF server for the right ascension.


Returns
the R.A. in the hex-string HH:MM::SS format. If connection to the proxy server is disabled, the string is empty.

◆ getRA() [2/2]

virtual std::string Laos::DrotServiceWorker::getRA ( )
virtual

◆ getReady() [1/2]

void Laos::DrotServiceWorker::getReady ( double  _startPosition,
std::string  _unit 
)
private

Move to the start/initial position of the rotator trajectory. Also convert the relative positions in m_positionSequence to absolute positions.


Parameters
_startPositionStart position of derotation.
_unitThe unit of the _startPosition value.

◆ getReady() [2/2]

void Laos::DrotServiceWorker::getReady ( double  _startPosition,
std::string  _unit 
)
private

◆ idleOnline() [1/2]

void Laos::DrotServiceWorker::idleOnline ( )
virtual

◆ idleOnline() [2/2]

virtual void Laos::DrotServiceWorker::idleOnline ( )
virtual

◆ init() [1/2]

void Laos::DrotServiceWorker::init ( )
virtual

This method initiate and open the interface.

Reimplemented from Basda::MoccaNServiceWorkerCore< double, double, Nice::Point, DrotServiceWorkerSkeleton >.

◆ init() [2/2]

virtual void Laos::DrotServiceWorker::init ( )
virtual

This method initiate and open the interface.

Reimplemented from Basda::MoccaNServiceWorkerCore< double, double, Nice::Point, DrotServiceWorkerSkeleton >.

◆ isRotating() [1/2]

bool Laos::DrotServiceWorker::isRotating ( )

◆ isRotating() [2/2]

bool Laos::DrotServiceWorker::isRotating ( )

◆ isSlewing() [1/2]

bool Laos::DrotServiceWorker::isSlewing ( )

◆ isSlewing() [2/2]

bool Laos::DrotServiceWorker::isSlewing ( )

◆ rewind() [1/2]

virtual void Laos::DrotServiceWorker::rewind ( Nice::Time  _durat,
bool  _go,
Nice::Time  _delay 
)
virtual

◆ rewind() [2/2]

void Laos::DrotServiceWorker::rewind ( Nice::Time  _durat,
bool  _go,
Nice::Time  _delay 
)
virtual

Move to the position where the previous derotation started and restart derotation.


Parameters
_duratThe duration of the trajectory to be started. Equivalent to specify a size of the derotator polynomial stack to be used. The argument is not used if _go=false.
_goIf true, do not just rewind but also start the derotation. If false, only rewind to previous start position and halt there.
_delayA time to delay the start into the future. If this is zero or negative, the function tries to calculate a reasonable time that should not lead to timeouts as shortly as possible into the future.
Since
2018-12-04

◆ startDerotation() [1/2]

void Laos::DrotServiceWorker::startDerotation ( const Nice::Date _startDate,
double  _startPosition,
std::string  _unit 
)
virtual

Get polynomials from the TCS, move to start position, and start the derotator motion.


Parameters
_startDateStart time of the derotation.
_startPositionStart position of the bearing.
_unitUnits of the start position.

◆ startDerotation() [2/2]

virtual void Laos::DrotServiceWorker::startDerotation ( const Nice::Date _startDate,
double  _startPosition,
std::string  _unit 
)
virtual

◆ startDerotationHere() [1/2]

void Laos::DrotServiceWorker::startDerotationHere ( const Nice::Date _startDate)
virtual

Get polynomials from the TCS and start the derotator motion. The difference to startDerotation() is that this function does not move the motor to any particular position but starts from where it is. The function is not overloading startDerotation() because this allows to have them both exposed to the Basda/ICE interface.


Parameters
_startDateStart time of the derotation.
Since
2017-06-08

◆ startDerotationHere() [2/2]

virtual void Laos::DrotServiceWorker::startDerotationHere ( const Nice::Date _startDate)
virtual

◆ startTimedDerotation() [1/2]

virtual void Laos::DrotServiceWorker::startTimedDerotation ( const Nice::Date _startDate,
double  _startPosition,
Nice::Time  _durat,
std::string  _unit 
)
virtual

◆ startTimedDerotation() [2/2]

void Laos::DrotServiceWorker::startTimedDerotation ( const Nice::Date _startDate,
double  _startPosition,
Nice::Time  _durat,
std::string  _unit 
)
virtual

Get polynomials from the TCS, move to start position, and start the derotator motion.


Parameters
_startDateStart time of the derotation.
_startPositionStart position of the bearing.
_unitUnits of the start position.
_duratThe time the trajectory should last. The actual duration of the trajectory will be the minimum o fthis parameter and of how much is left in the travel range if starting at the _startPosition parameter.
Since
2018-12-04

◆ timeLeft() [1/4]

Nice::Time Laos::DrotServiceWorker::timeLeft ( )

◆ timeLeft() [2/4]

Nice::Time Laos::DrotServiceWorker::timeLeft ( )

Get an estimate of the time that is left on the trajectory.


This subtracts the time "now" from the estimated finish time that was deposited in the property tree at the start of the derotation.

Returns
The estimated residual derotation time.
Warning
If used before the derotation started this will return zero seconds.
Since
2017-04-05
Author
R. J. Mathar

◆ timeLeft() [3/4]

Nice::Time Laos::DrotServiceWorker::timeLeft ( int  frequency,
double  _startPosition,
std::string  _unit,
bool  trunc 
)

◆ timeLeft() [4/4]

Nice::Time Laos::DrotServiceWorker::timeLeft ( int  frequency,
double  _startPosition,
std::string  _unit,
bool  trunc 
)

Get an estimate of the time that is left on the trajectory till hitting the limit switch.


Optionally truncate the list of positions such that the trajectory fits into the travel range.

This is a static evaluation of the profile; it does not look at what the current motor positions are or whether parts of the trajectory are already executed..

There is a basda-mocca/src/device/mpia/mocon/Module.cc with validateExternalProfile() that does a similar job. This is called by mpia/mocon/NDevice.cc, which is the base class of this here, within generateExternalProfile().

Parameters
_startPositionStart position of derotation. If the function is called after getReady(), the offset of the start position is already added to the local m_positionSequence, and the paramter _startPosition of this function here should be set to zero to avoid double application of the offset.
_unitThe unit of the _startPosition value.
truncIf true, truncate the polynomials. This means parts of the trajectory are deleted at the end (if needed) such that remaining first part can be excuted within the limit switches. This is useful to have a dynamic adaptation into the residual travel range; then validateExternalProfile() does not block execution of the entire trajectory.
Returns
The time estimate according to the profile and distance to the limit. This is the time interval needed to execute the trajectory starting at the start position until either the down-loaded polynomials are exhausted or until one of the limit switches is reached, whichever happens first.
Since
2017-04-05
Author
R. J. Mathar

◆ transformationFactorChanged() [1/2]

virtual void Laos::DrotServiceWorker::transformationFactorChanged ( const Nice::Any _a)
virtual

◆ transformationFactorChanged() [2/2]

void Laos::DrotServiceWorker::transformationFactorChanged ( const Nice::Any _a)
virtual

called automatically whenever the transformation property has changed.


Member Data Documentation

◆ m_ang_rad

double Laos::DrotServiceWorker::m_ang_rad
private

accumulated angle since trajectory start in radian

◆ m_ang_steps

double Laos::DrotServiceWorker::m_ang_steps
private

accumulated angle since trajectory start in steps

◆ m_direction

float Laos::DrotServiceWorker::m_direction
private

direction of motor steps relative to derotator polynomials.

Includes a factor 1/2 to slow down axle for the K-mirrors.

◆ m_iif

Ltcs::IifServiceWorkerInterfacePtr Laos::DrotServiceWorker::m_iif
private

the interface to ask the IIF for derotator polynomials or parallactic angle.


◆ m_numberOfPolynomials

int Laos::DrotServiceWorker::m_numberOfPolynomials
private

Number of polynomial slices from the IIF.

◆ m_positionSequence

Nice::NPoint Laos::DrotServiceWorker::m_positionSequence
private

◆ m_resolutionProperty

Nice::JointPtr Laos::DrotServiceWorker::m_resolutionProperty
private

◆ m_samplingRate

double Laos::DrotServiceWorker::m_samplingRate
private

Time interval for the duration of one derotator polynomial (seconds)

◆ m_startDate

Nice::Date Laos::DrotServiceWorker::m_startDate
private

projected start time of the derotator polynomial

◆ m_stepsPerDegree

double Laos::DrotServiceWorker::m_stepsPerDegree
private

number of motor steps to rotate by one degree

◆ m_stepsPerRad

double Laos::DrotServiceWorker::m_stepsPerRad
private

number of motor steps to rotate by one radian

◆ m_trange

Nice::Point Laos::DrotServiceWorker::m_trange
private

The configured travel range (steps)

Since
2018-12-04

◆ m_transformation

Nice::MapStringPoint Laos::DrotServiceWorker::m_transformation
private

A vector with the coordinate transformation values.

(eg. degree to steps)


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