Ejemplo n.º 1
0
 def _got_data(self, data):
     """
     """
     CommandResponseInstrumentProtocol._got_data(self, data)
     
     # Only keep the latest characters in the prompt buffer.
     if len(self._promptbuf)>7:
         self._promptbuf = self._promptbuf[-7:]
         
     # If we are streaming, process the line buffer for samples.
     if self._fsm.get_current_state() == SBE37State.AUTOSAMPLE:
         self._process_streaming_data()
Ejemplo n.º 2
0
    def _got_data(self, data):
        """ The comms object fires this when data is received
        
        @param data The chunk of data that was received
        """
        mi_logger.debug("*** Data received: %s, promptbuf: %s", data, self._promptbuf)
        CommandResponseInstrumentProtocol._got_data(self, data)

        # Only keep the latest characters in the prompt buffer.
        # if len(self._promptbuf)>7:
        #    self._promptbuf = self._promptbuf[-7:]

        # If we are streaming, process the line buffer for samples.
        if self._fsm.get_current_state() == State.AUTOSAMPLE_MODE:
            if self.eoln in self._linebuf:
                lines = self._linebuf.split(self.eoln)
                self._linebuf = lines[-1]
                for line in lines:
                    self.announce_to_driver(DriverAnnouncement.DATA_RECEIVED, msg=line)