def participantInfo():

    #Add an InfoPanel with a title bar
    participantInfo = vizinfo.InfoPanel('',
                                        title='Participant Information',
                                        align=viz.ALIGN_CENTER,
                                        icon=False)

    #Add name and ID fields
    textbox_nr = participantInfo.addLabelItem('NR', viz.addTextbox())
    participantInfo.addSeparator()
    textbox_id = participantInfo.addLabelItem('ID', viz.addTextbox())
    participantInfo.addSeparator()

    #Add submit button aligned to the right and wait until it's pressed
    submitButton = participantInfo.addItem(viz.addButtonLabel('Submit'),
                                           align=viz.ALIGN_RIGHT_CENTER)
    yield viztask.waitButtonUp(submitButton)

    #Collect participant data
    exp.pp_nr = "%02d" % (int(textbox_nr.get()), )
    exp.pp_id = textbox_id.get()
    pr.pp_nr = exp.pp_nr
    pr.pp_id = exp.pp_id

    participantInfo.remove()
Пример #2
0
	def __init__(self):
		#init canvas and create themes for the test panel
		self.canvas = viz.addGUICanvas(align = viz.ALIGN_CENTER_CENTER)
		self.canvas.setPosition(0,0,0)
		viz.mouse.setVisible(False)
		self.name = 'test'
		self._theme = viz.Theme()
		self._theme.borderColor = (0.1,0.1,0.1,1)
		self._theme.backColor = (0.4,0.4,0.4,1)
		self._theme.lightBackColor = (0.6,0.6,0.6,1)
		self._theme.darkBackColor = (0.2,0.2,0.2,1)
		self._theme.highBackColor = (0.2,0.2,0.2,1)
		self._theme.textColor = (1,1,1,1)
		self._theme.highTextColor = (1,1,1,1)
		
		#initialize test panel
		vizdlg.Panel.__init__(self, parent = self.canvas, theme = self._theme, align = viz.ALIGN_CENTER_TOP, fontSize = 15)
		self.visible(viz.OFF)
		self.setScale(*[i*config.menuScale[self.name] for i in [1,1,1]])
		self.alpha(0.6)
		
#		#title
		title = vizdlg.TitleBar('INSTRUCTIONS')
		self.addItem(title, align = viz.ALIGN_CENTER_TOP)
		
		#bones to be snapped. source snapped to target.
		source = 'a'*20
		self.sourceText = viz.addTextbox(parent = self.canvas)
		self.sourceText.setLength(1.5)
		target = 'a'*20
		self.targetText = viz.addTextbox(parent = self.canvas)
		self.targetText.setLength(1.5)
		
		#instructions 
		self.Instruct1 = self.addItem(viz.addText('Snap the: ', parent = self.canvas), align = viz.ALIGN_CENTER_TOP)
		self.sourceCommand = self.addItem(self.sourceText, align = viz.ALIGN_CENTER_TOP)
		self.Instruct2 = self.addItem(viz.addText('To the: ', parent = self.canvas), align = viz.ALIGN_CENTER_TOP)
		self.targetCommand = self.addItem(self.targetText, align = viz.ALIGN_CENTER_TOP)
		
		#render canvas
		
		if config.dispMode == config.DisplayMode.monitor:
			self.canvas.billboard(viz.BILLBOARD_YAXIS)
			self.canvas.setPosition(-2,0,0)
			self.canvas.setBackdrop(viz.ALIGN_CENTER_TOP)
			

		if config.dispMode == config.DisplayMode.oculus:

			bb = self.canvas.getBoundingBox()
			self.canvas.setRenderWorldOverlay([bb.width*1, bb.height*1], fov = bb.height, distance = 0.4)
			self.canvas.setPosition(0,0.05,0)
			self.canvasViewPos = self.canvas.getPosition()
			self.canvas.setEuler(0,15,0)
			self.canvas.setPosition(0, -5, 0)
			self.canvasHidePos = self.canvas.getPosition()
			viztask.schedule(self.updatePanelPos())
			
		vizact.onkeydown(viz.KEY_ESCAPE, self.toggle)
Пример #3
0
def getParticipantInfo():

    #Add an InfoPanel with a title bar
    participantInfo = vizinfo.InfoPanel('',
                                        title='Participant Information',
                                        align=viz.ALIGN_CENTER,
                                        icon=False)

    #Add name and ID fields
    textbox_last = participantInfo.addLabelItem('Last Name', viz.addTextbox())
    textbox_first = participantInfo.addLabelItem('First Name',
                                                 viz.addTextbox())
    textbox_id = participantInfo.addLabelItem('ID', viz.addTextbox())
    participantInfo.addSeparator(padding=(20, 20))

    #Add gender and age fields
    radiobutton_male = participantInfo.addLabelItem('Male',
                                                    viz.addRadioButton(0))
    radiobutton_female = participantInfo.addLabelItem('Female',
                                                      viz.addRadioButton(0))
    droplist_age = participantInfo.addLabelItem('Age Group', viz.addDropList())
    ageList = ['20-30', '31-40', '41-50', '51-60', '61-70']
    droplist_age.addItems(ageList)
    participantInfo.addSeparator(padding=(20, 20))

    #Add 2d 3D fields
    radiobutton_2D = participantInfo.addLabelItem('2D', viz.addRadioButton(1))
    radiobutton_3D = participantInfo.addLabelItem('3D', viz.addRadioButton(1))
    participantInfo.addSeparator(padding=(20, 20))

    #Add submit button aligned to the right and wait until it's pressed
    submitButton = participantInfo.addItem(viz.addButtonLabel('Submit'),
                                           align=viz.ALIGN_RIGHT_CENTER)
    yield viztask.waitButtonUp(submitButton)

    #Collect participant data
    data = viz.Data()
    data.lastName = textbox_last.get()
    data.firstName = textbox_first.get()
    data.id = textbox_id.get()
    data.ageGroup = ageList[droplist_age.getSelection()]

    if radiobutton_male.get() == viz.DOWN:
        data.gender = 'male'
    else:
        data.gender = 'female'

    if radiobutton_2D.get() == viz.DOWN:
        data.environment = '2D'
    else:
        data.environment = '3D'

    participantInfo.remove()

    # Return participant data
    viztask.returnValue(data)
Пример #4
0
def getParticipantInfo():

	#Add an InfoPanel with a title bar
	participantInfo = vizinfo.InfoPanel('',title='Participant Information',align=viz.ALIGN_CENTER, icon=False)

	#Add name and ID fields
	textbox_last = participantInfo.addLabelItem('Last Name',viz.addTextbox())
	textbox_first = participantInfo.addLabelItem('First Name',viz.addTextbox())
	textbox_id = participantInfo.addLabelItem('ID',viz.addTextbox())
	participantInfo.addSeparator(padding=(20,20))

	#Add gender and age fields
	radiobutton_male = participantInfo.addLabelItem('Male',viz.addRadioButton(0))
	radiobutton_female = participantInfo.addLabelItem('Female',viz.addRadioButton(0))
	droplist_age = participantInfo.addLabelItem('Age Group',viz.addDropList())
	ageList = ['20-30','31-40','41-50','51-60','61-70']
	droplist_age.addItems(ageList)
	participantInfo.addSeparator(padding=(20,20))
	
	#Add 2d 3D fields
	radiobutton_2D = participantInfo.addLabelItem('2D',viz.addRadioButton(1))
	radiobutton_3D = participantInfo.addLabelItem('3D',viz.addRadioButton(1))
	participantInfo.addSeparator(padding=(20,20))

	#Add submit button aligned to the right and wait until it's pressed
	submitButton = participantInfo.addItem(viz.addButtonLabel('Submit'),align=viz.ALIGN_RIGHT_CENTER)
	yield viztask.waitButtonUp(submitButton)

	#Collect participant data
	data = viz.Data()
	data.lastName = textbox_last.get()
	data.firstName = textbox_first.get()
	data.id = textbox_id.get()
	data.ageGroup = ageList[droplist_age.getSelection()]

	if radiobutton_male.get() == viz.DOWN:
		 data.gender = 'male'
	else:
		 data.gender = 'female'
		 
	if radiobutton_2D.get() == viz.DOWN:
		 data.environment = '2D'
	else:
		 data.environment = '3D'

	participantInfo.remove()

	# Return participant data
	viztask.returnValue(data)
Пример #5
0
    def __init__(self):

        viz.EventClass.__init__(self)
        self.done = viztask.Signal()
        self.callback(viz.BUTTON_EVENT, self.onButton)
        self.rowantext = """
Charactor Creation
Enter Your Charactor's name:
"""

        vizcam.PivotNavigate(center=[15, -10, 0],
                             distance=70,
                             sensitivity=[1.0, 1.0])

        self.text_2D_world = viz.addText(self.rowantext,
                                         pos=[2, 2, 2],
                                         scene=2)
        self.myButton2 = viz.addButtonLabel('Done!', scene=2)  #Add a button.

        self.myButton2.setPosition(.5, .5)  #Set its position.
        self.myButton2.setScale(1, 1)  #Scale it.

        #Add a text box.
        self.box = viz.addTextbox(scene=2)
        #self.box.message('default')
        #Make it twice as long.
        self.box.length(2)
        #Place it in window.
        self.box.setPosition(.5, .8)
        #Have it grow when text reaches its boundary.
        self.box.overflow(viz.OVERFLOW_GROW)
Пример #6
0
def displayInputPanel():
	global inputPanel, names
	
	inputPanel = viz.addGUIGroup()
#	endG = viz.addGroup(viz.SCREEN)
	splashScreen = viz.addTexQuad(parent=viz.SCREEN,pos=[0.5,0.5,0],scale=[13,10.5,1])
	splashScreen.texture(viz.addTexture('textures/splash_screen'+LANG+'.jpg'))
	splashScreen.setParent(inputPanel)
	names = []
	pl = range(condition%2*2+1)
	pl.reverse()
	for i,p in enumerate(pl):
		name = viz.addTextbox()
		nameText = {'':'Player %s name:', 'GR':'Όνομα παίκτη %s:'}
		title = viz.addText(nameText[LANG]%str(i+1), viz.SCREEN)
		title.fontSize(24)
		title.addParent(inputPanel)
		title.setPosition([.4, .53+.1*p, 0])
		name.setPosition([.5, .5+.1*p, 0])
		name.addParent(inputPanel)
		names.append(name)
	startB = viz.addButtonLabel('START')
	startB.setPosition(.5,.4)
	startB.addParent(inputPanel)
	vizact.onbuttonup(startB, initialize)
Пример #7
0
def participantInfo():
	info.visible(viz.OFF)
	participantInfo = vizinfo.InfoPanel('',title='Participant Information',align=viz.ALIGN_CENTER, icon=False)
	textbox_last = participantInfo.addLabelItem('Last Name',viz.addTextbox())
	textbox_first = participantInfo.addLabelItem('First Name',viz.addTextbox())
	textbox_id = participantInfo.addLabelItem('ID',viz.addTextbox())
	participantInfo.addSeparator(padding=(20,20))

	submitButton = participantInfo.addItem(viz.addButtonLabel('Submit'),align=viz.ALIGN_RIGHT_CENTER)
	yield viztask.waitButtonUp(submitButton)

	data = viz.Data()
	data.lastName = textbox_last.get()
	data.firstName = textbox_first.get()
	data.id = textbox_id.get()
	participantInfo.remove()
	viztask.returnValue(data)
Пример #8
0
def participantInfo():
     #Turn off visibility of proximity sensors and disable toggle
    manager.setDebug(viz.OFF)
    debugEventHandle.setEnabled(viz.OFF)

    #Hide info panel currently displayed
    info.visible(viz.OFF)

    #Add an InfoPanel with a title bar
    participantInfo = vizinfo.InfoPanel('',title='Participant Information',align=viz.ALIGN_CENTER, icon=False)

    #Add name and ID fields
    textbox_last = participantInfo.addLabelItem('Last Name',viz.addTextbox())
    textbox_first = participantInfo.addLabelItem('First Name',viz.addTextbox())
    textbox_id = participantInfo.addLabelItem('ID',viz.addTextbox())
    participantInfo.addSeparator(padding=(20,20))

    #Add gender and age fields
    radiobutton_male = participantInfo.addLabelItem('Male',viz.addRadioButton(0))
    radiobutton_female = participantInfo.addLabelItem('Female',viz.addRadioButton(0))
    droplist_age = participantInfo.addLabelItem('Age Group',viz.addDropList())
    ageList = ['20-30','31-40','41-50','51-60','61-70']
    droplist_age.addItems(ageList)
    participantInfo.addSeparator()

    #Add submit button aligned to the right and wait until it's pressed
    submitButton = participantInfo.addItem(viz.addButtonLabel('Submit'),align=viz.ALIGN_RIGHT_CENTER)
    yield viztask.waitButtonUp(submitButton)
	
	#Collect participant data
    data = viz.Data()
    data.lastName = textbox_last.get()
    data.firstName = textbox_first.get()
    data.id = textbox_id.get()
    data.ageGroup = ageList[droplist_age.getSelection()]

    if radiobutton_male.get() == viz.DOWN:
         data.gender = 'male'
    else:
         data.gender = 'female'

    participantInfo.remove()

    # Return participant data
    viztask.returnValue(data)
Пример #9
0
def participantInfo():

    manager.setDebug(viz.OFF)
    debugEventHandle.setEnabled(viz.OFF)

    # Hide info panel currently displayed
    info.visible(viz.OFF)

    # Add an InfoPanel with a title bar
    participantInfo = vizinfo.InfoPanel("", title="Participant Information", align=viz.ALIGN_CENTER, icon=False)

    # Add name and ID fields
    textbox_last = participantInfo.addLabelItem("Last Name", viz.addTextbox())
    textbox_first = participantInfo.addLabelItem("First Name", viz.addTextbox())
    textbox_id = participantInfo.addLabelItem("ID", viz.addTextbox())
    participantInfo.addSeparator(padding=(20, 20))

    # Add gender and age fields
    radiobutton_male = participantInfo.addLabelItem("Male", viz.addRadioButton(0))
    radiobutton_female = participantInfo.addLabelItem("Female", viz.addRadioButton(0))
    droplist_age = participantInfo.addLabelItem("Age Group", viz.addDropList())
    ageList = ["20-30", "31-40", "41-50", "51-60", "61-70"]
    droplist_age.addItems(ageList)
    participantInfo.addSeparator()

    # Add submit button aligned to the right and wait until it's pressed
    submitButton = participantInfo.addItem(viz.addButtonLabel("Submit"), align=viz.ALIGN_RIGHT_CENTER)
    yield viztask.waitButtonUp(submitButton)

    # Collect participant data
    data = viz.Data()
    data.lastName = textbox_last.get()
    data.firstName = textbox_first.get()
    data.id = textbox_id.get()
    data.ageGroup = ageList[droplist_age.getSelection()]

    if radiobutton_male.get() == viz.DOWN:
        data.gender = "male"
    else:
        data.gender = "female"

    participantInfo.remove()

    # Return participant data
    viztask.returnValue(data)
Пример #10
0
	def __init__(self):
		"""Init canvas and create themes for the test panel"""
		self.canvas = viz.addGUICanvas(parent = viz.ABS_GLOBAL)
		viz.mouse.setVisible(False)
		self.name = 'test'
		
		self._theme					= viz.Theme()
		self._theme.borderColor		= (0.1,0.1,0.1,1)
		self._theme.backColor		= (0.4,0.4,0.4,1)
		self._theme.lightBackColor	= (0.6,0.6,0.6,1)
		self._theme.darkBackColor	= (0.2,0.2,0.2,1)
		self._theme.highBackColor	= (0.2,0.2,0.2,1)
		self._theme.textColor		= (1,1,1,1)
		self._theme.highTextColor	= (1,1,1,1)
		
		# Initialize test panel
		vizdlg.Panel.__init__(self, parent = self.canvas, theme = self._theme, align = viz.ALIGN_CENTER, fontSize = 10)
		self.visible(viz.OFF)
		self.setScale(*[i*config.menuScale[self.name] for i in [1,1,1]])
		
		# Title
		title = vizdlg.TitleBar('INSTRUCTIONS')
		self.addItem(title, align = viz.ALIGN_CENTER_TOP)
		
		# Bones to be snapped. source snapped to target.
		self.sourceText = viz.addTextbox(parent = self.canvas)
		self.sourceText.setLength(1.5)
		self.targetText = viz.addTextbox(parent = self.canvas)
		self.targetText.setLength(1.5)
		
		# Instructions 
		self.Instruct1		= self.addItem(viz.addText('Snap the: ', parent = self.canvas), align = viz.ALIGN_CENTER_TOP)
		self.sourceCommand	= self.addItem(self.sourceText, align = viz.ALIGN_CENTER_TOP)
		self.Instruct2		= self.addItem(viz.addText('To the: ', parent = self.canvas), align = viz.ALIGN_CENTER_TOP)
		self.targetCommand	= self.addItem(self.targetText, align = viz.ALIGN_CENTER_TOP)
		
		# Render canvas
		bb = self.getBoundingBox()
		self.canvas.setRenderWorld([bb.height, bb.width],[4, 3*1.333])
		
		# On esc toggle menu (doesn't interfere with in-game menu)
#		vizact.onkeydown(viz.KEY_ESCAPE, self.toggle)
		self.canvas.setPosition(0.0,2.0,4.0)
		self.canvas.resolution(self.canvas.getResolution())
Пример #11
0
from TimelineGen import Timeline

# file to unpickle
pickle_path = "pathGen67130"

# experiment settings go here
test_fov = 34
Timeline.trialTime = 60
Timeline.numDead = 0
Timeline.deadLength = 2
Timeline.minLiveLength = 2
numtrials = PathGenerator.numPaths
test_timeline = Timeline()

# text box for showing messages
tbox = viz.addTextbox()
tbox.setPosition(0.5, 0.35)

# function to run the experiment
def run_tasks():
    global pickle_path
    global tbox, message, numtrials, test_fov, test_timeline

    # load path set from file
    unpicklefile = open(pickle_path, "r")
    pg = pickle.load(unpicklefile)
    unpicklefile.close()

    newPg = PathGenerator()

    # show space bar message
Пример #12
0
    def __init__(self):
        #init canvas and create themes for the test panel
        self.canvas = viz.addGUICanvas(align=viz.ALIGN_CENTER_CENTER)
        self.canvas.setPosition(0, 0, 0)
        viz.mouse.setVisible(False)
        self.name = 'test'
        self._theme = viz.Theme()
        self._theme.borderColor = (0.1, 0.1, 0.1, 1)
        self._theme.backColor = (0.4, 0.4, 0.4, 1)
        self._theme.lightBackColor = (0.6, 0.6, 0.6, 1)
        self._theme.darkBackColor = (0.2, 0.2, 0.2, 1)
        self._theme.highBackColor = (0.2, 0.2, 0.2, 1)
        self._theme.textColor = (1, 1, 1, 1)
        self._theme.highTextColor = (1, 1, 1, 1)

        #initialize test panel
        vizdlg.Panel.__init__(self,
                              parent=self.canvas,
                              theme=self._theme,
                              align=viz.ALIGN_CENTER_TOP,
                              fontSize=15)
        self.visible(viz.OFF)
        self.setScale(*[i * config.menuScale[self.name] for i in [1, 1, 1]])
        self.alpha(0.6)

        #		#title
        title = vizdlg.TitleBar('INSTRUCTIONS')
        self.addItem(title, align=viz.ALIGN_CENTER_TOP)

        #bones to be snapped. source snapped to target.
        source = 'a' * 20
        self.sourceText = viz.addTextbox(parent=self.canvas)
        self.sourceText.setLength(1.5)
        target = 'a' * 20
        self.targetText = viz.addTextbox(parent=self.canvas)
        self.targetText.setLength(1.5)

        #instructions
        self.Instruct1 = self.addItem(viz.addText('Snap the: ',
                                                  parent=self.canvas),
                                      align=viz.ALIGN_CENTER_TOP)
        self.sourceCommand = self.addItem(self.sourceText,
                                          align=viz.ALIGN_CENTER_TOP)
        self.Instruct2 = self.addItem(viz.addText('To the: ',
                                                  parent=self.canvas),
                                      align=viz.ALIGN_CENTER_TOP)
        self.targetCommand = self.addItem(self.targetText,
                                          align=viz.ALIGN_CENTER_TOP)

        #render canvas

        if config.dispMode == config.DisplayMode.monitor:
            self.canvas.billboard(viz.BILLBOARD_YAXIS)
            self.canvas.setPosition(-2, 0, 0)
            self.canvas.setBackdrop(viz.ALIGN_CENTER_TOP)

        if config.dispMode == config.DisplayMode.oculus:

            bb = self.canvas.getBoundingBox()
            self.canvas.setRenderWorldOverlay([bb.width * 1, bb.height * 1],
                                              fov=bb.height,
                                              distance=0.4)
            self.canvas.setPosition(0, 0.05, 0)
            self.canvasViewPos = self.canvas.getPosition()
            self.canvas.setEuler(0, 15, 0)
            self.canvas.setPosition(0, -5, 0)
            self.canvasHidePos = self.canvas.getPosition()
            viztask.schedule(self.updatePanelPos())

        vizact.onkeydown(viz.KEY_ESCAPE, self.toggle)
Пример #13
0
def participantInfo():
    #Add an InfoPanel with a title bar
    participantInfo = vizinfo.InfoPanel('',
                                        title='Participant Information',
                                        align=viz.ALIGN_CENTER,
                                        icon=False)

    #Add ID field
    textbox_id = participantInfo.addLabelItem('ID', viz.addTextbox())
    participantInfo.addSeparator(padding=(10, 10))

    #Add eye height field
    textbox_EH = participantInfo.addLabelItem('Eye Height (m)',
                                              viz.addTextbox())
    participantInfo.addSeparator(padding=(10, 10))

    #Add age field
    textbox_age = participantInfo.addLabelItem('Age', viz.addTextbox())
    participantInfo.addSeparator(padding=(10, 10))

    #Add gender field
    radiobutton_male = participantInfo.addLabelItem('Male',
                                                    viz.addRadioButton(0))
    radiobutton_female = participantInfo.addLabelItem('Female',
                                                      viz.addRadioButton(0))
    radiobutton_other = participantInfo.addLabelItem('Non-Binary',
                                                     viz.addRadioButton(0))
    participantInfo.addSeparator()

    #Add units field
    radiobutton_feet = participantInfo.addLabelItem('Feet',
                                                    viz.addRadioButton(1))
    radiobutton_meters = participantInfo.addLabelItem('Meters',
                                                      viz.addRadioButton(1))
    participantInfo.addSeparator()

    #Add submit button aligned to the right and wait until it's pressed
    submitButton = participantInfo.addItem(viz.addButtonLabel('Submit'),
                                           align=viz.ALIGN_RIGHT_CENTER)
    yield viztask.waitButtonUp(submitButton)

    #Collect participant data
    global data
    data = viz.Data()
    data_id = textbox_id.get()
    data_EH = textbox_EH.get()
    data_age = textbox_age.get()

    if radiobutton_male.get() == viz.DOWN:
        data.gender = 'm'
    elif radiobutton_female.get() == viz.DOWN:
        data.gender = 'f'
    else:
        data.gender = 'nb'

    if radiobutton_feet.get() == viz.DOWN:
        data.units = 'ft'
    else:
        data.units = 'm'

    participantInfo.remove()

    global IDNum
    IDNum = int(data_id)
    print IDNum
    global age
    age = float(data_age)
    global EHNum
    EHNum = float(data_EH)
    print age
    print EHNum
    print data.gender
    print data.units
Пример #14
0
    environment = viz.addChild('sky_day.osgb')
else:
    environment = viz.addChild('sky_night.osgb')
environment.setScale(10, 10, 10)
track.setScale(5, 0, 5)
station.setScale(5, 5, 5)
#buildings.setScale(1, 1, 1)
station.setEuler(90, 0, 0)
track.setPosition(260, -3, 15)
tower.setPosition(500, -3, -75)
tower.setScale(1.5, 4, 1.5)
station.setPosition(-100, -3.3, 250)
station.collideMesh()
#buildings.collideMesh()
tower.collideMesh()
speeddisplay = viz.addTextbox()
speeddisplay.setPosition(0.11, 0.985)
steerdisplay = viz.addTextbox()
steerdisplay.setPosition(0.11, 0.95)
cardisplay = viz.addTextbox()
cardisplay.setPosition(0.9, 0.02)
geardisplay = viz.addTextbox()
geardisplay.setPosition(0.11, 0.915)
headLight = viz.MainView.getHeadLight()
headLight.disable()
myLight = viz.addLight()
view = viz.MainView
if environmentchoice == 0:
    myLight.intensity(1)
else:
    myLight.intensity(0.25)
Пример #15
0
	elif ( tophatwindow != -1 and msg == -1 and tophatclicked == 0 ):
		nfalseneg += 1
		print [ncorrect, nfalsepos, nfalseneg]
	
	tophatwindow=msg
	#if(msg != -1):
	#	tbox.message("tophat window"+str(msg))
	#else:
	#	tbox.message("tophat not in a window! :(")
	#tbox2.message("tophat angle: "+str(angle))
	#print "viewing angle: ",y
	
	tbox2.message( str(ncorrect)+" "+str(nfalsepos)+" "+str(nfalseneg))

	
tbox = viz.addTextbox()	
tbox.setPosition(0.5,0.35)
tbox2 = viz.addTextbox()
tbox2.setPosition(0.5,0.65)
tbox2.visible(viz.OFF)
numtasks = 18
random_seeds = []
results = []


fov_values = [10, 20, 34]
latency_values = [1, 6, 12]



conditions = []
Пример #16
0
def landmark():

    object = viz.pick()

    if object.valid() and object == bomb_in_school:
        textbox1 = viz.addTextbox()
        #Make it twice as long.
        textbox1.length(2)
        textbox1.setPosition(.5, .5)
        #Have it grow when text reaches its boundary.

        textbox1.overflow(viz.OVERFLOW_GROW)

        textbox1.message('you are at the public school')

        textbox1.add(fadeInOut)

    elif object.valid() and object == bomb_in_trashcan:

        textbox1 = viz.addTextbox()

        #Make it twice as long.

        textbox1.length(2)

        textbox1.setPosition(.5, .5)

        #Have it grow when text reaches its boundary.

        textbox1.overflow(viz.OVERFLOW_GROW)

        textbox1.message('you are at the park')

        textbox1.add(fadeInOut)

    elif object.valid() and object == police_station:

        textbox1 = viz.addTextbox()

        #Make it twice as long.

        textbox1.length(2)

        textbox1.setPosition(.5, .5)

        #Have it grow when text reaches its boundary.

        textbox1.overflow(viz.OVERFLOW_GROW)

        textbox1.message('you are at the police station')

        textbox1.add(fadeInOut)

    elif object.valid() and object == bomb_in_schoolbus:

        textbox1 = viz.addTextbox()

        #Make it twice as long.

        textbox1.length(2)

        textbox1.setPosition(.5, .5)

        #Have it grow when text reaches its boundary.

        textbox1.overflow(viz.OVERFLOW_GROW)

        textbox1.message('you are near to school bus')

        textbox1.add(fadeInOut)

    elif object.valid() and object == bomb_under_car_at_gas_station:

        textbox1 = viz.addTextbox()

        #Make it twice as long.

        textbox1.length(2)

        textbox1.setPosition(.5, .5)

        #Have it grow when text reaches its boundary.

        textbox1.overflow(viz.OVERFLOW_GROW)

        textbox1.message('you are  at the gas station')

        textbox1.add(fadeInOut)
    def participant_info():
        """
        Query the participant for basic data.

        Questions to select experimental condition and control type of the experimental condition.

        Returns: the queried data as a viz.data object

        """

        participant_info = vizinfo.InfoPanel('', title='Participant Information', align=viz.ALIGN_CENTER, icon=False)

        # query control style droplist; Create a drop-down list
        drop_control_style = participant_info.addLabelItem('Choose control style', viz.addDropList())
        items = ['dk2 head & right hand', 'mouse and keyboard'] # 'mouse and keyboard', 'joystick', 'dk2 head only', 'dk2 head wiimote',
        drop_control_style.addItems(items)

        # Add name and ID fields of maze configurations
        drop_maze_config = participant_info.addLabelItem('Choose maze configuration', viz.addDropList())
        items2 = ['auto', 'baseline', 'training', 'I', 'L', 'Z', 'U']#, 'T', '+']  # Add a list of items.
        drop_maze_config.addItems(items2)

        # Add name and ID fields of experimental condition
        drop_maze_run = participant_info.addLabelItem('Choose maze run', viz.addDropList())
        items2 = ['auto', '1', '2', '3']
        drop_maze_run.addItems(items2)

        participant_info.addSeparator(padding=(10, 10))

        textbox_id = participant_info.addLabelItem('ID', viz.addTextbox())
        textbox_age = participant_info.addLabelItem('Age', viz.addTextbox())
        textbox_handedness = participant_info.addLabelItem('Handedness', viz.addTextbox())
        textbox_vision = participant_info.addLabelItem('Vision', viz.addTextbox())
        textbox_cap_size = participant_info.addLabelItem('Cap size', viz.addTextbox())
        textbox_neck_size = participant_info.addLabelItem('Neck size', viz.addTextbox())
        textbox_labelscheme = participant_info.addLabelItem('Electrode Labelscheme', viz.addTextbox())

        participant_info.addSeparator(padding=(10, 10))

        # Add gender and age fields
        radiobutton_male = participant_info.addLabelItem('Male', viz.addRadioButton(2))
        radiobutton_female = participant_info.addLabelItem('Female', viz.addRadioButton(2))

        participant_info.addSeparator(padding=(10, 10))

        # Add submit button aligned to the right and wait until it's pressed
        submit_button = participant_info.addItem(viz.addButtonLabel('Submit'), align=viz.ALIGN_CENTER)
        yield viztask.waitButtonUp(submit_button)

        # Collect participant data
        data = viz.Data()
        data.id = textbox_id.get()
        data.age = textbox_age.get()
        data.handedness = textbox_handedness.get()
        data.vision = textbox_vision.get()
        data.cap_size = textbox_cap_size.get()
        data.neck_size = textbox_neck_size.get()
        data.labelscheme = textbox_labelscheme.get()

        if radiobutton_male.get() == viz.DOWN:
            data.sex = 'male'
        else:
            data.sex = 'female'

        # Find the index of the current selection. Find the selection itself.
        data.control_style = drop_control_style.getItems()[drop_control_style.getSelection()]
        data.maze_config = drop_maze_config.getItems()[drop_maze_config.getSelection()]
        data.maze_run = drop_maze_run.getItems()[drop_maze_run.getSelection()]

        participant_info.remove()

        # Return participant data
        viztask.returnValue(data)
Пример #18
0
GRAPHIC_RAM = [[0 for x in range(6)] for y in range(10)]
MEMLOCS = [
    'F0184BF1', 'F01A4BF2', 'F0111BF3', 'FFFF04F4', 'F0184BF5', 'F01A4BF6',
    'F0111BF7', 'FFFF04E8', 'F0111B00', 'BFFF0401'
]
SCHEDUL_MEM = [
    'B0184BF1', 'B01A4BF2', 'B0111BF3', 'BFFF04F4', 'B0184BF5', 'B01A4BF6',
    'B0111BF7', 'BFFF04E8', 'B0111B00', 'BFFF0401'
]
CPUREG = ['R0', 'R1', 'R2', 'R3', 'R4', 'R5', 'R6', 'R7', 'R8', 'R9']

for a in range(0, 10):
    PCB_GUI[a].addItem(viz.addText("PCB " + str(a)))
    PCB_GUI[a].color(viz.AZURE)
    for b in range(0, 6):
        GRAPHIC_RAM[a][b] = viz.addTextbox()
        GRAPHIC_RAM[a][b].setScale(0.9, 1)

        PCB_GUI[a].addItem(GRAPHIC_RAM[a][b])

    GRAPHIC_RAM[a][0].message('READY')
    GRAPHIC_RAM[a][1].message('00000000')

    GRAPHIC_RAM[a][2].message(str(CPUREG[a]))
    GRAPHIC_RAM[a][3].message(str(viz.random.choice(MEMLOCS)))
    GRAPHIC_RAM[a][4].message(str(viz.random.choice(SCHEDUL_MEM)))
    GRAPHIC_RAM[a][5].message(str(viz.random.randrange(2, 10)))

    #CREATE LIST OF PROCESSES
#=============================================================================
##Process1