def setFromTime(self, time_sec=time.time() ):
"""
Create a sdds time object from the input parameter. If the time_sec is from the epoch
then we need to convert to the current year as per spec.
"""
if time_sec:
if time_sec >= self.startofyear:
# UTC.. need to convert to SDDS EPOCH
time_sec = time_sec - self.startofyear
pfrac, pwhole = math.modf(time_sec*Time.TicFreq)
self.ps250_ = long(pwhole)
self.pf250_ = int( pfrac*Time.Two32)
#print "td: %12Lu %12u %16.2Lf " % ( self.ps250_, self.pf250_, pfrac )
评论列表
文章目录