本文整理匯總了Python中timeline.Timeline.Size方法的典型用法代碼示例。如果您正苦於以下問題:Python Timeline.Size方法的具體用法?Python Timeline.Size怎麽用?Python Timeline.Size使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類timeline.Timeline
的用法示例。
在下文中一共展示了Timeline.Size方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: OnInit
# 需要導入模塊: from timeline import Timeline [as 別名]
# 或者: from timeline.Timeline import Size [as 別名]
def OnInit(self):
try:
if self.options.record:
# Connect to ROS master
if not self.connect_to_ros():
raise Exception('recording requires connection to master')
# Get filename to record to
record_filename = time.strftime('%Y-%m-%d-%H-%M-%S.bag', time.localtime(time.time()))
if self.options.name:
record_filename = self.options.name
if not record_filename.endswith('.bag'):
record_filename += '.bag'
elif self.options.prefix:
prefix = self.options.prefix
if prefix.endswith('.bag'):
prefix = prefix[:-len('.bag')]
if prefix:
record_filename = '%s_%s' % (prefix, record_filename)
rospy.loginfo('Recording to %s.' % record_filename)
# Create main timeline frame
self.frame = BaseFrame(None, 'rxbag', 'Timeline')
self.frame.BackgroundColour = wx.WHITE
self.frame.Bind(wx.EVT_CLOSE, lambda e: wx.Exit())
scroll = wx.ScrolledWindow(self.frame, -1)
scroll.BackgroundColour = wx.WHITE
timeline = Timeline(scroll, -1)
timeline.Size = (100, 100)
self.frame.Show()
self.SetTopWindow(self.frame)
timeline.SetFocus()
if self.options.record:
timeline.record_bag(record_filename, all=self.options.all, topics=self.args, regex=self.options.regex, limit=self.options.limit)
else:
RxBagInitThread(self, timeline)
except Exception, ex:
print >> sys.stderr, 'Error initializing application:', ex
#import traceback
#traceback.print_exc()
return False