当前位置: 首页>>代码示例>>Python>>正文


Python TimerCallback.callback方法代码示例

本文整理汇总了Python中director.timercallback.TimerCallback.callback方法的典型用法代码示例。如果您正苦于以下问题:Python TimerCallback.callback方法的具体用法?Python TimerCallback.callback怎么用?Python TimerCallback.callback使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在director.timercallback.TimerCallback的用法示例。


在下文中一共展示了TimerCallback.callback方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: startApplication

# 需要导入模块: from director.timercallback import TimerCallback [as 别名]
# 或者: from director.timercallback.TimerCallback import callback [as 别名]
def startApplication(enableQuitTimer=False):
    appInstance = QtGui.QApplication.instance()
    if enableQuitTimer:
        quitTimer = TimerCallback()
        quitTimer.callback = appInstance.quit
        quitTimer.singleShot(0.1)
    appInstance.exec_()
开发者ID:patmarion,项目名称:director,代码行数:9,代码来源:testPropertiesPanel.py

示例2: main

# 需要导入模块: from director.timercallback import TimerCallback [as 别名]
# 或者: from director.timercallback.TimerCallback import callback [as 别名]
def main():

    app = consoleapp.ConsoleApp()

    meshCollection = lcmobjectcollection.LCMObjectCollection('MESH_COLLECTION_COMMAND')
    affordanceCollection = lcmobjectcollection.LCMObjectCollection('AFFORDANCE_COLLECTION_COMMAND')

    meshCollection.sendEchoRequest()
    affordanceCollection.sendEchoRequest()

    def printCollection():
        print
        print '----------------------------------------------------'
        print datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
        print '%d affordances' % len(affordanceCollection.collection)
        for desc in affordanceCollection.collection.values():
            print
            print 'name:', desc['Name']
            print 'type:', desc['classname']


    timer = TimerCallback(targetFps=0.2)
    timer.callback = printCollection
    timer.start()

    #app.showPythonConsole()
    app.start()
开发者ID:RobotLocomotion,项目名称:director,代码行数:29,代码来源:affordanceServer.py

示例3: startQuitTimer

# 需要导入模块: from director.timercallback import TimerCallback [as 别名]
# 或者: from director.timercallback.TimerCallback import callback [as 别名]
 def startQuitTimer(timeoutInSeconds):
     quitTimer = TimerCallback()
     quitTimer.callback = ConsoleApp.quit
     quitTimer.singleShot(timeoutInSeconds)
开发者ID:rxdu,项目名称:director,代码行数:6,代码来源:consoleapp.py

示例4: spawnBasicLabel

# 需要导入模块: from director.timercallback import TimerCallback [as 别名]
# 或者: from director.timercallback.TimerCallback import callback [as 别名]
  ql.setMinimum(min)
  ql.setOrientation(QtCore.Qt.Vertical)
  return ql

statusLabel = spawnBasicLabel()
l.addWidget(wrapInVTitledItem("Behavior", [statusLabel]))

def statusUpdate():
  behavior = atlasDriver.getCurrentBehaviorName()
  statusLabel.setText(behavior)
  if (behavior != "user"):
    statusLabel.setStyleSheet(LABEL_DEFAULT_STYLE_SHEET + "background-color:red; color:white")
  else:
    statusLabel.setStyleSheet(LABEL_DEFAULT_STYLE_SHEET + "background-color:white; color:black")
statusTimer = TimerCallback(targetFps=FPS)
statusTimer.callback =  statusUpdate
statusTimer.start()

controllerLabel = spawnBasicLabel()
l.addWidget(wrapInVTitledItem("Controller", [controllerLabel]))
def controllerUpdate():
  status = atlasDriver.getControllerStatus()
  if not status:
    status = "Unknown"
  if len(status) > 6:
    status = status[0:6]
  rate = atlasDriver.getControllerRate()
  if not rate:
    rate = 0.0
  controllerLabel.setText("%s\n%06.1fhz" % (status, rate))
  if (rate < 500):
开发者ID:RobotLocomotion,项目名称:director,代码行数:33,代码来源:atlasHealthPanel.py

示例5: TimerCallback

# 需要导入模块: from director.timercallback import TimerCallback [as 别名]
# 或者: from director.timercallback.TimerCallback import callback [as 别名]


#########################
numRays = 20
rayLength = 5
angleMin = -np.pi/2
angleMax = np.pi/2
angleGrid = np.linspace(angleMin, angleMax, numRays)
rays = np.zeros((3,numRays))
rays[0,:] = np.cos(angleGrid)
rays[1,:] = np.sin(angleGrid)


timer = TimerCallback(targetFps=30)
timer.callback = tick


playTimer = TimerCallback(targetFps=30)
playTimer.callback = tick3






app = ConsoleApp()
view = app.createView()


panel = QtGui.QWidget()
开发者ID:peteflorence,项目名称:DirectSim,代码行数:32,代码来源:movingIntersection.py


注:本文中的director.timercallback.TimerCallback.callback方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。