本文整理汇总了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()
示例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
示例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'
示例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
示例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'