コード例 #1
0
ファイル: experiment.py プロジェクト: compmem/psyqt
    def __init__(self, ChildMode=QState.ExclusiveStates, new_timeline=False):
        # Must fix the following hack
        try:
            exp
            no_exp = False
        except:
            no_exp = True

        if no_exp:
            self._saved_parent = None
        else:
            self._saved_parent = exp._current_parent
            
        QState.__init__(self, ChildMode,
                        parent=self._saved_parent)        

        # connect to previous state if needed
        if not no_exp:
            exp._add_transition_if_needed(self)

        # add in a timeline
        if new_timeline:
            self.timeline = Timeline()
        else:
            # grab from parent
            self.timeline = self._saved_parent.timeline

        # grab the starting offset for this child
        if no_exp:
            self.cur_event_time = 0
        else:
            self.cur_event_time = self._saved_parent.cur_event_time

        # save amount shifted
        self.amount_advanced = 0
コード例 #2
0
ファイル: experiment.py プロジェクト: paulhendricks/psyqt
    def __init__(self, ChildMode=QState.ExclusiveStates, new_timeline=False):
        # Must fix the following hack
        try:
            exp
            no_exp = False
        except:
            no_exp = True

        if no_exp:
            self._saved_parent = None
        else:
            self._saved_parent = exp._current_parent

        QState.__init__(self, ChildMode, parent=self._saved_parent)

        # connect to previous state if needed
        if not no_exp:
            exp._add_transition_if_needed(self)

        # add in a timeline
        if new_timeline:
            self.timeline = Timeline()
        else:
            # grab from parent
            self.timeline = self._saved_parent.timeline

        # grab the starting offset for this child
        if no_exp:
            self.cur_event_time = 0
        else:
            self.cur_event_time = self._saved_parent.cur_event_time

        # save amount shifted
        self.amount_advanced = 0
コード例 #3
0
ファイル: experiment.py プロジェクト: compmem/psyqt
    def __init__(self, parent=None, event_time=None):
        if parent is None:
            # grab from current exp
            parent = exp._current_parent
        # can't have children other than those we define, so must be
        # set up as ExclusiveStates
        QState.__init__(self, QState.ExclusiveStates, parent=parent)
        # set up dummy initial and final child states
        self._iState = QState(parent=self)
        self._fState = QFinalState(parent=self)
        self.setInitialState(self._iState)
        self._iState.addTransition(self._iState.finished,self._fState)

        # add to a timeline and save time
        self.parent = parent
        if event_time is None:
            event_time = self.parent.cur_event_time
        self._event_time = event_time
        parent.timeline.add_state(self, self._event_time)
コード例 #4
0
ファイル: experiment.py プロジェクト: paulhendricks/psyqt
    def __init__(self, parent=None, event_time=None):
        if parent is None:
            # grab from current exp
            parent = exp._current_parent
        # can't have children other than those we define, so must be
        # set up as ExclusiveStates
        QState.__init__(self, QState.ExclusiveStates, parent=parent)
        # set up dummy initial and final child states
        self._iState = QState(parent=self)
        self._fState = QFinalState(parent=self)
        self.setInitialState(self._iState)
        self._iState.addTransition(self._iState.finished, self._fState)

        # add to a timeline and save time
        self.parent = parent
        if event_time is None:
            event_time = self.parent.cur_event_time
        self._event_time = event_time
        parent.timeline.add_state(self, self._event_time)