Acspy.Common.TimeHelper
index
/alma/ACS-2016.6/ACSSW/lib/python/site-packages/Acspy/Common/TimeHelper.py

This module contains the implementation of Python helper classes for the ACS
time system.  Specifically, these classes mimic what has been done by the
Control subsystem in C++.
 
TODO:
- getTimeStamp should get the Time from a Clock component!

 
Modules
       
acstime
time

 
Classes
       
__builtin__.object
TimeUtil

 
class TimeUtil(__builtin__.object)
    TimeUtil is a utility class providing static methods to convert
between Python and ACS time systems. It is very similar to the C++ class
of the same name except that it deals with native Python time format instead
of "ACE" time.
 
  Methods defined here:
__init__(self)
Constructor does not really initialize anything as this class has no
members and consists solely of static methods.
duration2py(self, duration)
Convert an ACS duration to a Python duration.
 
Parameters: duration is in units of 100 nanoseconds
 
Return: duration converted to seconds
 
Raises: Nothing
epoch2py(self, epoch)
Convert an ACS Epoch to a Python Epoch.
 
Parameters: epoch is the number of 100 nanoseconds that have passed since
October 15, 1582.
 
Return: epoch converted a Python Epoch (i.e., seconds that have passed
since January 1, 1970.)
 
Raises: Nothing
py2duration(self, seconds)
Convert seconds to 100 nanoseconds.
 
Parameters: seconds is the number of seconds to convert
 
Return: seconds converted to units of 100 nanoseconds packed into a
Duration struct.
 
Raises: Nothing
py2epoch(self, seconds)
Convert Python Epoch (i.e., seconds since 1/1/1970 to ACS
Epoch (i.e., 100 nanoseconds since 15/10/1582).
 
Parameters:
- seconds is the number of seconds that have passed
since January 1, 1970.
 
Return: seconds converted to units of 100 nanoseconds since
October 15, 1582 and packed into an acstime.Epoch struct.
 
Raises: Nothing

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
Functions
       
getTimeStamp()
Returns the current timestamp in acstime.Epoch format. To convert this value
to a long, just use getTimeStamp().value
 
Parameters: None
 
Returns: the current time in an ACS Epoch structure
 
Raises: Nothing

 
Data
        __revision__ = '$Id: TimeHelper.py,v 1.1.1.1 2012/03/07 17:40:45 acaproni Exp $'