From 31232905c0ddfed6d4fa353de322490dde7c649e Mon Sep 17 00:00:00 2001 From: jfkominsky Date: Sun, 8 Dec 2019 10:59:07 -0500 Subject: [PATCH] New screen identifier script This will ultimately get rolled into the builder, but it's a simple script for identifying which physical screen has which screen index. --- PyHab/PyHabClassHPP.py | 2 +- ScreenIdentifier.py | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 ScreenIdentifier.py diff --git a/PyHab/PyHabClassHPP.py b/PyHab/PyHabClassHPP.py index 0d92830..0170ad1 100644 --- a/PyHab/PyHabClassHPP.py +++ b/PyHab/PyHabClassHPP.py @@ -1077,7 +1077,7 @@ def SetupWindow(self): :rtype: """ if self.stimPres: - # Stimulus presentation window + # Stimulus presentation window self.win = visual.Window((self.screenWidth['C'], self.screenHeight['C']), fullscr=False, screen=self.screenIndex['C'], allowGUI=False, units='pix', color=self.screenColor['C']) self.winL = visual.Window((self.screenWidth['L'], self.screenHeight['L']), fullscr=False, screen=self.screenIndex['L'], allowGUI=False, diff --git a/ScreenIdentifier.py b/ScreenIdentifier.py new file mode 100644 index 0000000..9766bc9 --- /dev/null +++ b/ScreenIdentifier.py @@ -0,0 +1,27 @@ +from psychopy import visual, event, core, gui, monitors, tools, sound,__version__ +from psychopy.app import coder +import wx, random, csv, shutil, os, sys, threading, itertools +from math import * +from copy import deepcopy +import pyglet + +""" +A simple tool for identifying which screen has which screen index +""" + +defDisp = pyglet.window.get_platform().get_default_display() +allScrs = defDisp.get_screens() + +screenList = list(range(0, len(allScrs))) +winList = [] + +for i in range(0, len(screenList)): + tmpWin = visual.Window(size=(400,300), pos=(0,0),units='norm',screen=screenList[i]) + tmpTxt = visual.TextStim(tmpWin, text=str(screenList[i]), pos=(0,0)) + tmpTxt.draw() + tmpWin.flip() + winList.append(tmpWin) + +event.waitKeys() +for j in range(0, len(winList)): + winList[j].close() \ No newline at end of file