def __init__(self, number=1): QApplication.__init__(self, sys.argv) self.setApplicationName("SphereTest") self.mainWindow = QMainWindow() self.gl_widget = proPixx480_1440test() self.mainWindow.setCentralWidget(self.gl_widget) self.mainWindow.setGeometry( QtGui.QDesktopWidget().availableGeometry(1)) self.mainWindow.showFullScreen() self.curr_time = time.time() self.timer = QTimer() self.timer.setInterval(0) self.timer.timeout.connect(self.gl_widget.update) self.timer.start() self.timer2 = QTimer() self.timer2.setInterval(3000) self.timer2.timeout.connect(self.printFrames) self.timer2.start() self.gl_widget.mode = number self.gl_widget.mouseDoubleClickEvent = lambda x: self.mainWindow.close( ) self.previous_time = 0 self.previous_total = 0 my_device = PROPixx() if number is 0: # 480 Hz my_device.setDlpSequencerProgram('QUAD4X') else: # 1440 Hz my_device.setDlpSequencerProgram('QUAD12X') my_device.updateRegisterCache() sys.exit(self.exec_()) # Start Qt main loop
def set_video_mode(self, mode): '''Sets the projector's video mode. ``mode`` can be one of video_modes. ''' if PROPixx is None: raise ImportError('Cannot open PROPixx library') self.video_mode = mode dev = PROPixx() dev.setDlpSequencerProgram(mode) dev.updateRegisterCache() dev.close()
def set_video_mode(self, mode): '''Sets the projector's video mode. ``mode`` can be one of :attr:`ViewControllerBase.video_modes`. ''' if PROPixx is None: if ignore_vpixx_import_error: return raise ImportError('Cannot open PROPixx library') dev = PROPixx() dev.setDlpSequencerProgram(mode) dev.updateRegisterCache() dev.close()
def set_video_mode(self, mode): '''Sets the projector's video mode. ``mode`` can be one of video_modes. ''' if PROPixx is None: raise ImportError('Cannot open PROPixx library') modes = { 'RGB': 'RGB 120Hz', 'QUAD4X': 'RGB Quad 480Hz', 'QUAD12X': 'GREY Quad 1440Hz' } self.video_mode = mode dev = PROPixx() dev.setDlpSequencerProgram(modes[mode]) dev.updateRegisterCache() dev.close()
def set_video_mode(self, mode): '''Sets the projector's video mode. ``mode`` can be one of :attr:`ViewControllerBase.video_modes`. ''' if self.vpixx_remote: App.get_running_app().remote_viewer.send_vpixx_command( 'video_mode', (mode, )) return if PROPixx is None: raise ImportError('Cannot open PROPixx library') dev = PROPixx() dev.setDlpSequencerProgram(mode) dev.updateRegisterCache() dev.close()
autoLog=False) stimArea = visual.GratingStim(win, size=1.5, tex=None, pos=(0, 0), color=-1, mask='circle', autoLog=False) myCtrl = PROPixxCTRL() print('PROPixxCTRL') print('-----------') print('Serial number : {}'.format(myCtrl.serial_number)) print('Firmware revision: {}'.format(myCtrl.firmware_revision)) myDevice = PROPixx() print('PROPixx') print('-----------') print('Serial number : {}'.format(myDevice.serial_number)) print('Firmware revision: {}'.format(myDevice.firmware_revision)) refreshRateHZ = 'RGB' # 120 HZ myDevice.setDlpSequencerProgram(refreshRateHZ) myDevice.updateRegisterCache() # In [5]: hex(0b000000010101010101010100) # Out[5]: '0x15554' bitmask = 0xFFFFFF DPxSelectDevice('PROPixx Ctrl') for bb in range(16):
from pypixxlib.propixx import PROPixx, PROPixxCTRL from pypixxlib._libdpx import DPxSelectDevice # DPxSelectDevice('PROPixx Ctrl') myCtrl = PROPixxCTRL() print('PROPixxCTRL') print('-----------') print('Serial number : {}'.format(myCtrl.serial_number)) print('Firmware revision: {}'.format(myCtrl.firmware_revision)) # DPxSelectDevice('PROPixx') myDevice = PROPixx() print('PROPixx') print('-----------') print('Serial number : {}'.format(myDevice.serial_number)) print('Firmware revision: {}'.format(myDevice.firmware_revision)) # Outputs # # pypixxlib version 3.4.4448 # PROPixxCTRL # ----------- # Serial number : 71001-0826 # Firmware revision: 52 # PROPixx # ----------- # Serial number : 70001-0856 # Firmware revision: 41 # # If the new VPixx server isn't running, but trying to use ppl>=3.5, we get: # Unable to connect to server!
from pypixxlib.propixx import PROPixx, PROPixxCTRL from pypixxlib._libdpx import DPxSelectDevice my_device = PROPixx() my_device_controller = PROPixxCTRL() my_device.setRearProjectionMode( True) # Sets the projector to read-projection mode. my_device.setCeilingMountMode( True) # Sets the projector to ceiling-mount mode. my_device.setVesaFreeRun( True) # Sets the VESA port to work with the polariser. my_device.updateRegisterCache() # Update the new modes to the device. my_device.setCustomStartupConfig( ) # The projector will remember this configuration. # The audio is done on the controller, so the next functions use the controller object. my_device_controller.audio.initializeCodec() # Configures initial CODEC state. my_device_controller.audio.setLeftRightMode( 'mono') # Set which mode the audio will be output. my_device_controller.audio.setAudioBuffer( 0, 64) # Set the audio to start at address 0, and size 64. # Now we must create the audio stimulus. # This is done by simply filling a list with a sound wave. audio_stim = [] import math for i in range(32): audio_stim.append(int(32767 * math.sin(2.0 * math.pi * i / 32.0))) my_device_controller.writeRam( 0, audio_stim) # Write the audio stimulus in the ram. my_device_controller.audio.setVolume(0.25) my_device_controller.updateRegisterCache() # Send everything to the device.
from pypixxlib._libdpx import DPxSelectDevice, DPxSetReg16, DPxUpdateRegCache import ctypes from pypixxlib.propixx import PROPixx dev = PROPixx() dev.setDlpSequencerProgram('RGB') dev.setVesaFreeRun(False) dev.updateRegisterCache() DPxSelectDevice('PROPixx') # Select the PROPixx DPxSetReg16(ctypes.c_uint(0x18C), ctypes.c_uint(1)) DPxUpdateRegCache()
from pypixxlib.propixx import PROPixx my_device = PROPixx() my_device.setDlpSequencerProgram('QUAD4X') my_device.updateRegisterCache() # You can now send you stimulus at 120 Hz to be displayed at 480 Hz!