def _show_wizard(self): from libqtopensesame.dialogs.loop_wizard import loop_wizard d = loop_wizard(self.main_window) dm = d.exec_() if dm is None: return self.dm = dm self.update()
def _show_wizard(self): """ desc: Shows the full-factorial-design wizard. """ from libqtopensesame.dialogs.loop_wizard import loop_wizard d = loop_wizard(self.main_window) dm = d.exec_() if dm is None: return self.dm = dm self.update()
def wizard(self): """Presents the variable wizard dialog.""" from libqtopensesame.dialogs.loop_wizard import loop_wizard d = loop_wizard(self.experiment.main_window) if d.exec_() == QtGui.QDialog.Accepted: #cfg.loop_wizard = a.ui.table_wizard.get_contents() debug.msg(u"filling loop table") # First read the table into a dictionary of variables var_dict = {} for col in range(d.column_count()): var = None for row in range(d.row_count()): item = d.get_item(row, col) if item == None: break s = unicode(item.text()) if s == u'': break if row == 0: var = self.experiment.sanitize(s, True) var_dict[var] = [] elif var != None: var_dict[var].append(s) # If the variable wizard was not parsed correctly, provide a # notification and do nothin if len(var_dict) == 0: self.experiment.notify( _(u'You provided an empty or invalid variable definition. For an example of a valid variable definition, open the variable wizard and select "Show example".')) return # Then fill the loop table self.i = 0 self.matrix = {} self.wizard_process(var_dict) self.set_cycle_count(len(self.matrix)) self.lock = True self.loop_widget.ui.spin_cycles.setValue(self.cycle_count()) self.lock = False self.refresh_loop_table() self.refresh_summary() self.apply_edit_changes()
def wizard(self): """Presents the variable wizard dialog.""" from libqtopensesame.dialogs.loop_wizard import loop_wizard d = loop_wizard(self.experiment.main_window) if d.exec_() == QtGui.QDialog.Accepted: #cfg.loop_wizard = a.ui.table_wizard.get_contents() debug.msg(u"filling loop table") # First read the table into a dictionary of variables var_dict = {} for col in range(d.column_count()): var = None for row in range(d.row_count()): item = d.get_item(row, col) if item is None: break s = str(item.text()) if s == u'': break if row == 0: var = self.experiment.syntax.sanitize(s, True) var_dict[var] = [] elif var is not None: var_dict[var].append(s) # If the variable wizard was not parsed correctly, provide a # notification and do nothin if len(var_dict) == 0: self.experiment.notify( _(u'You provided an empty or invalid variable definition. For an example of a valid variable definition, open the variable wizard and select "Show example".' )) return # Then fill the loop table self.i = 0 self.matrix = {} self.wizard_process(var_dict) self.set_cycle_count(len(self.matrix)) self.lock = True self.loop_widget.ui.spin_cycles.setValue(self.cycle_count()) self.lock = False self.refresh_loop_table() self.refresh_summary() self.apply_edit_changes()