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()
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)
def grab_info(self): """ Reads the information from the vizinfo widgets and fills in details about this subject. """ self.show_gui() yield viztask.waitButtonUp(run_button) self.subject_id = "S%03i" % int(id_box.get()) self.run_num = "R%02i" % int(run_box.get()) self.day_num = "D%02i" % int(day_box.get()) self.is_scanning = bool(scan_box.get()) self.is_training = bool(training_box.get()) info_box.remove()
def grab_info(self): """ Reads the information from the vizinfo widgets and fills in details about this subject. """ self.show_gui() yield viztask.waitButtonUp(run_button) self.subject_id = "S%03i"%int(id_box.get()) self.run_num = "R%02i"%int(run_box.get()) self.day_num = "D%02i"%int(day_box.get()) self.is_scanning = bool(scan_box.get()) self.is_training = bool(training_box.get()) info_box.remove()
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)
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)
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)
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)
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
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)