def putx(self, delta):
# Adjust granularity.
if delta == 0 or delta >= 1:
- delta_s = u"%us" % (delta)
+ delta_s = "%.1fs" % (delta)
elif delta <= 1e-12:
- delta_s = u"%.1ffs" % (delta * 1e15)
+ delta_s = "%.1ffs" % (delta * 1e15)
elif delta <= 1e-9:
- delta_s = u"%.1fps" % (delta * 1e12)
+ delta_s = "%.1fps" % (delta * 1e12)
elif delta <= 1e-6:
- delta_s = u"%.1fns" % (delta * 1e9)
+ delta_s = "%.1fns" % (delta * 1e9)
elif delta <= 1e-3:
- delta_s = u"%.1fμs" % (delta * 1e6)
+ delta_s = "%.1fμs" % (delta * 1e6)
else:
- delta_s = u"%.1fms" % (delta * 1e3)
+ delta_s = "%.1fms" % (delta * 1e3)
self.put(self.clk_start, self.sig_start, self.out_ann, [0, [delta_s]])
def putp(self, period_t):
# Adjust granularity.
if period_t == 0 or period_t >= 1:
- period_s = u'%u s' % (period_t)
+ period_s = '%.1f s' % (period_t)
elif period_t <= 1e-12:
- period_s = u'%.1f fs' % (period_t * 1e15)
+ period_s = '%.1f fs' % (period_t * 1e15)
elif period_t <= 1e-9:
- period_s = u'%.1f ps' % (period_t * 1e12)
+ period_s = '%.1f ps' % (period_t * 1e12)
elif period_t <= 1e-6:
- period_s = u'%.1f ns' % (period_t * 1e9)
+ period_s = '%.1f ns' % (period_t * 1e9)
elif period_t <= 1e-3:
- period_s = u'%.1f μs' % (period_t * 1e6)
+ period_s = '%.1f μs' % (period_t * 1e6)
else:
- period_s = u'%.1f ms' % (period_t * 1e3)
+ period_s = '%.1f ms' % (period_t * 1e3)
self.put(self.ss, self.es, self.out_ann, [1, [period_s]])