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


Python Computer.getIoHubProcess方法代码示例

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


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

示例1: test_getProcesses

# 需要导入模块: from psychopy.iohub import Computer [as 别名]
# 或者: from psychopy.iohub.Computer import getIoHubProcess [as 别名]
    def test_getProcesses(self):
        assert Computer.is_iohub_process is False
        assert Computer.psychopy_process == Computer.getCurrentProcess()
        assert Computer.current_process == Computer.psychopy_process
        assert Computer.iohub_process == Computer.getIoHubProcess()
        assert Computer.iohub_process.pid == Computer.iohub_process_id

        assert Computer.getCurrentProcess().is_running()
        assert Computer.getIoHubProcess().is_running()
        assert Computer.getIoHubProcess().parent() == Computer.getCurrentProcess()
开发者ID:DennisEckmeier,项目名称:psychopy,代码行数:12,代码来源:test_computer.py

示例2: startHubProcess

# 需要导入模块: from psychopy.iohub import Computer [as 别名]
# 或者: from psychopy.iohub.Computer import getIoHubProcess [as 别名]
def startHubProcess():
    io = launchHubServer()
    assert io != None

    io_proc = Computer.getIoHubProcess()
    io_proc_pid = io_proc.pid
    assert io_proc != None and io_proc_pid > 0

    return io
开发者ID:ChenTzuYin,项目名称:psychopy,代码行数:11,代码来源:testutil.py

示例3: test_procPriority

# 需要导入模块: from psychopy.iohub import Computer [as 别名]
# 或者: from psychopy.iohub.Computer import getIoHubProcess [as 别名]
    def test_procPriority(self):
        local_priority = Computer.getPriority()
        iohub_priority_rpc = self.io.getPriority()
        assert local_priority == 'normal'
        assert iohub_priority_rpc == 'normal'

        priority_level = Computer.setPriority('high', True)
        assert priority_level == 'high'
        priority_level = self.io.setPriority('high', True)
        assert priority_level == 'high'
        priority_level = Computer.setPriority('normal')
        assert priority_level == 'normal'
        priority_level = self.io.setPriority('normal')
        assert priority_level == 'normal'

        priority_level = Computer.setPriority('realtime')
        assert priority_level == 'realtime'
        priority_level = self.io.setPriority('realtime')
        assert priority_level == 'realtime'
        priority_level = Computer.setPriority('normal')
        assert priority_level == 'normal'
        priority_level = self.io.setPriority('normal')
        assert priority_level == 'normal'

        # >> Deprecated functionality tests
        psycho_proc = Computer.psychopy_process
        iohub_proc = Computer.getIoHubProcess()

        psycho_priority = Computer.getProcessPriority(psycho_proc)
        iohub_priority = Computer.getProcessPriority(iohub_proc)
        assert psycho_priority == 'normal'
        assert local_priority == psycho_priority
        assert iohub_priority == 'normal'
        assert iohub_priority == iohub_priority_rpc

        priority_change_ok = Computer.enableHighPriority()
        new_psycho_priority = Computer.getProcessPriority(psycho_proc)
        assert priority_change_ok == False or new_psycho_priority == 'high'

        priority_change_ok = self.io.enableHighPriority()
        new_io_priority = Computer.getProcessPriority(iohub_proc)
        assert priority_change_ok == False or new_io_priority == 'high'

        priority_change_ok = Computer.disableHighPriority()
        new_psycho_priority = Computer.getProcessPriority(psycho_proc)
        assert priority_change_ok == False or new_psycho_priority == 'normal'

        priority_change_ok = self.io.disableHighPriority()
        new_io_priority = Computer.getProcessPriority(iohub_proc)
        assert priority_change_ok == False or new_io_priority == 'normal'
开发者ID:DennisEckmeier,项目名称:psychopy,代码行数:52,代码来源:test_computer.py

示例4: stopHubProcess

# 需要导入模块: from psychopy.iohub import Computer [as 别名]
# 或者: from psychopy.iohub.Computer import getIoHubProcess [as 别名]
def stopHubProcess():
    from psychopy.iohub.client import ioHubConnection

    io = ioHubConnection.getActiveConnection()
    assert io != None

    io_proc = Computer.getIoHubProcess()
    io_proc_pid = io_proc.pid
    assert io_proc != None and psutil.pid_exists(io_proc_pid)

    # Stop iohub server, ending process.
    io.quit()

    # Enure iohub proc has terminated.
    assert not psutil.pid_exists(io_proc_pid)

    assert ioHubConnection.getActiveConnection() is None
开发者ID:ChenTzuYin,项目名称:psychopy,代码行数:19,代码来源:testutil.py

示例5: test_procPriority

# 需要导入模块: from psychopy.iohub import Computer [as 别名]
# 或者: from psychopy.iohub.Computer import getIoHubProcess [as 别名]
    def test_procPriority(self):
        psycho_proc = Computer.psychopy_process
        iohub_proc = Computer.getIoHubProcess()

        psycho_priority = Computer.getProcessPriority(psycho_proc)
        iohub_priority = Computer.getProcessPriority(iohub_proc)
        assert psycho_priority == 'normal'
        assert iohub_priority == 'normal'

        priority_change_ok = Computer.enableHighPriority()
        new_psycho_priority = Computer.getProcessPriority(psycho_proc)
        assert priority_change_ok == False or new_psycho_priority == 'high'

        priority_change_ok = self.io.enableHighPriority()
        new_io_priority = Computer.getProcessPriority(iohub_proc)
        assert priority_change_ok == False or new_io_priority == 'high'

        priority_change_ok = Computer.disableHighPriority()
        new_psycho_priority = Computer.getProcessPriority(psycho_proc)
        assert priority_change_ok == False or new_psycho_priority == 'normal'

        priority_change_ok = self.io.disableHighPriority()
        new_io_priority = Computer.getProcessPriority(iohub_proc)
        assert priority_change_ok == False or new_io_priority == 'normal'
开发者ID:Lx37,项目名称:psychopy,代码行数:26,代码来源:test_computer.py


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