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


Python Field.check_for_abandoned_cells方法代码示例

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


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

示例1: main

# 需要导入模块: from field import Field [as 别名]
# 或者: from field.Field import check_for_abandoned_cells [as 别名]
def main():
    # Configure logging
    setup_logging()

    # create logger
    logger = logging.getLogger(__name__)

    # initialize stuff
    field = Field()
    
    osc = OSCHandler()
    conductor = Conductor()
    field.update(osc=osc)
    osc.update(field=field, conductor=conductor)
    conductor.update(field=field)

    if os.path.isfile('settings.py'):
        logger.info( "Loading settings from settings.py")
        execfile('settings.py')

    keep_running = True
    lastframe = None
    lasttime = 0
    while keep_running:
        # call user script
        osc.each_frame()

        if field.m_frame != lastframe or \
            time() - lasttime > 1:
            # do conductor calculations and inferences
            field.check_for_abandoned_cells()
            conductor.update_all_cells()
            conductor.update_all_conx()

            # send regular reports out
            osc.send_regular_reports()
            lastframe = field.m_frame
            lasttime = time()
        else:
            # Still on the same frame, sleep for a fraction of the frame time to not hog CPU
            #field.m_osc.send_laser('/conductor/sleep',[field.m_frame])    # Useful for debugging -- can see in OSC stream when this process was sleeping
            sleep((1.0/config.framerate)/10)

        keep_running = osc.m_run & field.m_still_running

    osc.m_oscserver.close()
开发者ID:wmodes,项目名称:crs,代码行数:48,代码来源:main.py


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