def _updateSequenceInfo(self, r):
<EOL>newSequence = False<EOL>sequenceId = (r[self._sequenceIdIdx]<EOL>if self._sequenceIdIdx is not None else None)<EOL>if sequenceId != self._currSequence:<EOL><INDENT>if sequenceId in self._sequences:<EOL><INDENT>raise Exception('<STR_LIT>' %(sequenceId, r))<EOL><DEDENT>self._sequences.add(self._currSequence)<EOL>self._currSequence = sequenceId<EOL>if self._resetIdx:<EOL><INDENT>assert r[self._resetIdx] == <NUM_LIT:1><EOL><DEDENT>newSequence = True<EOL><DEDENT>else:<EOL><INDENT>reset = False<EOL>if self._resetIdx:<EOL><INDENT>reset = r[self._resetIdx]<EOL>if reset == <NUM_LIT:1>:<EOL><INDENT>newSequence = True<EOL><DEDENT><DEDENT><DEDENT>if not newSequence:<EOL><INDENT>if self._timeStampIdx and self._currTime is not None:<EOL><INDENT>t = r[self._timeStampIdx]<EOL>if t < self._currTime:<EOL><INDENT>raise Exception('<STR_LIT>' % r)<EOL><DEDENT><DEDENT><DEDENT>if self._timeStampIdx:<EOL><INDENT>self._currTime = r[self._timeStampIdx]<EOL><DEDENT>
Keep track of sequence and make sure time goes forward

        Check if the current record is the beginning of a new sequence
        A new sequence starts in 2 cases:

        1. The sequence id changed (if there is a sequence id field)
        2. The reset field is 1 (if there is a reset field)

        Note that if there is no sequenceId field or resetId field then the entire
        dataset is technically one big sequence. The function will not return True
        for the first record in this case. This is Ok because it is important to
        detect new sequences only when there are multiple sequences in the file.