コード例 #1
0
    def __init__(self, parent, session, responseCallback, **kwds):
        wx.Panel.__init__(self, parent, -1, **kwds)

        self.sizer = wx.BoxSizer(orient=wx.VERTICAL)
        self.SetSizer(self.sizer)

        self.stimulus = StimulusPanel(self, session, self._onTrialEnd)
        self.sizer.Add(self.stimulus, 0, wx.EXPAND)

        self.response = ResponsePanel(self, session, responseCallback)
        self.sizer.Add(self.response, 0, wx.EXPAND)
コード例 #2
0
 def __init__(self, parent, session, responseCallback, **kwds):
     wx.Panel.__init__(self, parent, -1, **kwds)
     
     self.sizer = wx.BoxSizer(orient=wx.VERTICAL)
     self.SetSizer(self.sizer)
     
     self.stimulus = StimulusPanel(self, session, self._onTrialEnd)
     self.sizer.Add(self.stimulus, 0, wx.EXPAND)
     
     self.response = ResponsePanel(self, session, responseCallback)
     self.sizer.Add(self.response, 0, wx.EXPAND)
コード例 #3
0
class ExperimentPanel(wx.Panel):
    """
    Main container and primary manager for running experiment.
    """
    def __init__(self, parent, session, responseCallback, **kwds):
        wx.Panel.__init__(self, parent, -1, **kwds)

        self.sizer = wx.BoxSizer(orient=wx.VERTICAL)
        self.SetSizer(self.sizer)

        self.stimulus = StimulusPanel(self, session, self._onTrialEnd)
        self.sizer.Add(self.stimulus, 0, wx.EXPAND)

        self.response = ResponsePanel(self, session, responseCallback)
        self.sizer.Add(self.response, 0, wx.EXPAND)

    def setBlockType(self, blockType):
        print "--->new Block:", blockType
        if (blockType == "AV"):
            self.response.showAgreement()
        else:
            self.response.hideAgreement()

    def setTrial(self, trial):
        print "--->trial started:", trial.prettyValues()
        self.response.reset()
        self.response.setTrial(trial)

        self.stimulus.setTrial(trial)
        self.stimulus.show()

    def getTrial(self):
        return self.response.getTrial()

    def _onTrialEnd(self):
        print "--->trial ended", self.response.trial.prettyValues()
        self.response.show()
        self.response.SetFocus()
コード例 #4
0
class ExperimentPanel(wx.Panel):
    """
    Main container and primary manager for running experiment.
    """
    def __init__(self, parent, session, responseCallback, **kwds):
        wx.Panel.__init__(self, parent, -1, **kwds)
        
        self.sizer = wx.BoxSizer(orient=wx.VERTICAL)
        self.SetSizer(self.sizer)
        
        self.stimulus = StimulusPanel(self, session, self._onTrialEnd)
        self.sizer.Add(self.stimulus, 0, wx.EXPAND)
        
        self.response = ResponsePanel(self, session, responseCallback)
        self.sizer.Add(self.response, 0, wx.EXPAND)
        
    def setBlockType(self, blockType):
        print "--->new Block:", blockType
        if (blockType=="AV"):
            self.response.showAgreement()
        else: 
            self.response.hideAgreement()
    
    def setTrial(self, trial):
        print "--->trial started:", trial.prettyValues()
        self.response.reset()
        self.response.setTrial(trial)
        
        self.stimulus.setTrial(trial)
        self.stimulus.show()
        
    def getTrial(self):
        return self.response.getTrial()
        
    def _onTrialEnd(self):
        print "--->trial ended", self.response.trial.prettyValues()
        self.response.show()
        self.response.SetFocus()