def loadConfig(self):
        """Loads config from file and rebuilds whole tree"""
        l_fileName = QtGui.QFileDialog().getOpenFileName(
            self, self.tr(u"Otwórz"),
            QtCore.QString(settings.module_abs_path()), "*")
        if l_fileName == "":
            return
        self.fileName = unicode(l_fileName)
        l_shortFileName = os.path.split(unicode(l_fileName))[1]
        self.setWindowTitle("test")
        print "filename: ", l_fileName
        #f = open(l_fileName)
        #print f.readlines()

        #Config = ConfigParser.ConfigParser()
        self.Config.read(
            "/home/mrygacz/openbci/openbci/openbci/modules/exp/config.ini")

        for section in self.Config.sections():
            print section

        self.ui.textEdit.setPlainText(self.Config.get("Book", "title"))
Example #2
0
    if event.getKeys(["escape"]): core.quit()
    #refresh the screen
    if continueRoutine:  #don't flip if this routine is over or we'll get a blank screen
        win.flip()

#end of routine instruct
for thisComponent in instructComponents:
    if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False)

#set up handler to look after randomisation of conditions etc
trials = data.TrialHandler(nReps=1000.0,
                           method='random',
                           extraInfo=expInfo,
                           originPath=None,
                           trialList=data.importConditions(
                               os.path.join(settings.module_abs_path(),
                                            'trialTypes.xlsx')),
                           seed=None)
thisTrial = trials.trialList[0]  #so we can initialise stimuli with some values
#abbreviate parameter names if possible (e.g. rgb=thisTrial.rgb)
if thisTrial != None:
    for paramName in thisTrial.keys():
        exec(paramName + '=thisTrial.' + paramName)
#PK-b
#PK: totalCorrect, totalIncorrect counts number of correct/incorrect decisions
#PK: treshold - required number of correct (incorrect) deciosion
#PK: maxTime - time that user is given to answer
totalCorrect = 0
totalIncorrect = 0
treshold = 40
maxTime = 2
Example #3
0
    def saveConfigAs(self):
        """Saves config to specified file"""
        l_fileName = QtGui.QFileDialog().getSaveFileName(self, self.tr("Zapisz jako..."), QtCore.QString(settings.module_abs_path()), "Plik UGMa (*.ugm)")

        if l_fileName == "": 
            return
        elif not unicode(l_fileName).endswith('.ugm'):
            l_fileName += '.ugm'

        self.fileName = l_fileName
        
        self.saveConfig()
Example #4
0
 def loadConfig(self):
     """Loads config from file and rebuilds whole tree"""
     l_fileName = QtGui.QFileDialog().getOpenFileName(self, self.tr(u"Otwórz"), QtCore.QString(settings.module_abs_path()), "Pliki UGMa (*.ugm)")
     if l_fileName == "": 
         return    
     self.fileName = unicode(l_fileName)
     l_shortFileName = os.path.split(unicode(l_fileName))[1]
     self.setWindowTitle(QtGui.QApplication.translate("UGMMainWidget", "UGM Configuration - %s" % (l_shortFileName), None, QtGui.QApplication.UnicodeUTF8))
     
     self.configManager.update_from_file(self.fileName)
     l_attributesConfig = self.configManager.get_attributes_config()
     self._initModel(UGMPropertiesModel(l_attributesConfig['attributes_def'], 
                                          l_attributesConfig['attributes_for_elem'], 
                                          self.configManager.get_ugm_fields()))
    def loadConfig(self):
        """Loads config from file and rebuilds whole tree"""
        l_fileName = QtGui.QFileDialog().getOpenFileName(self, self.tr(u"Otwórz"), QtCore.QString(settings.module_abs_path()), "*")
        if l_fileName == "": 
            return    
        self.fileName = unicode(l_fileName)
        l_shortFileName = os.path.split(unicode(l_fileName))[1]
        self.setWindowTitle("test")
	print "filename: ", l_fileName
        #f = open(l_fileName)
	#print f.readlines()
	
        #Config = ConfigParser.ConfigParser()
	self.Config.read("/home/mrygacz/openbci/openbci/openbci/modules/exp/config.ini")
	
	for section in self.Config.sections():
	    print section

	self.ui.textEdit.setPlainText(self.Config.get("Book","title"))
Example #6
0
    # refresh the screen
    if continueRoutine:  # don't flip if this routine is over or we'll get a blank screen
        win.flip()

# end of routine instruct
for thisComponent in instructComponents:
    if hasattr(thisComponent, "setAutoDraw"):
        thisComponent.setAutoDraw(False)

# set up handler to look after randomisation of conditions etc
trials = data.TrialHandler(
    nReps=1000.0,
    method="random",
    extraInfo=expInfo,
    originPath=None,
    trialList=data.importConditions(os.path.join(settings.module_abs_path(), "trialTypes.xlsx")),
    seed=None,
)
thisTrial = trials.trialList[0]  # so we can initialise stimuli with some values
# abbreviate parameter names if possible (e.g. rgb=thisTrial.rgb)
if thisTrial != None:
    for paramName in thisTrial.keys():
        exec(paramName + "=thisTrial." + paramName)
# PK-b
# PK: totalCorrect, totalIncorrect counts number of correct/incorrect decisions
# PK: treshold - required number of correct (incorrect) deciosion
# PK: maxTime - time that user is given to answer
totalCorrect = 0
totalIncorrect = 0
treshold = 40
maxTime = 2