def reset_xaui(self, args): lev = BYTE.unpack(args[0])[0] for board in [self._dbe, self._bee2]: board.regwrite('xaui_rst', lev) board.logger.info('xaui_rst=%d' % board.regread('xaui_rst')) board.regwrite('xaui_rst', 0) board.logger.info('xaui_rst=%d' % board.regread('xaui_rst')) return BYTE.pack(0)
def _board(self, ibob, command, *args): argstr = ' '.join(str(a) for a in args) cmdstr = "%s %s %s" %(ibob, command, argstr) size, err, resp = self._request(BYTE.pack(15) + cmdstr) if err: self.logger.warning("error using _ibob_tinysh!") return resp
def operations_log(self, level, logger, msg): argstr = '{0}\r{1}'.format(logger, msg) cmdstr = pack('!B%ds' %len(argstr), level, argstr) size, err, resp = self._request(BYTE.pack(96) + cmdstr) if err: elf.logger.warning("error sending operations log!") return self.logger.log(level, "sent server logger {1}: {0} {2}".format( level, logger, msg ))
def get_correlation(self): cmd = BYTE.pack(128) size, err, pkt = self._request(cmd) if err: raise NoCorrelations self.logger.debug('received: %r' % pkt) header_struct = BEE2CorrelationProvider._header_struct data = pkt[header_struct.size:] # should be 3 arrays and 2 floats corr_time, left, right, current, total = header_struct.unpack(pkt[:header_struct.size]) lagss, visibss, fitss, m, c = self.unpacker.unpack(data) return ( corr_time, left, right, current, total, # header information loads(lagss), loads(visibss), loads(fitss), m, c # data )
def arm_sync(self, args): self.sync_all() return BYTE.pack(0)
def stop_fstopping(self): cmd = BYTE.pack(19) size, err, resp = self._request(cmd)
def get_reference(self): cmd = BYTE.pack(16) size, err, resp = self._request(cmd) return BYTE.unpack(resp)[0]
def clear_walsh_table(self): cmd = BYTE.pack(6) size, err, resp = self._request(cmd) if err: self.logger.error("error clearing Walsh table!")
def load_walsh_table(self): cmd = BYTE.pack(5) size, err, resp = self._request(cmd) if err: self.logger.error("error loading Walsh table!")
def get_dbe_gains(self): cmd = BYTE.pack(64) size, err, resp = self._request(cmd) if err: self.logger.warning("error getting DBE channel gains!") return unpack('!16I', resp)
def arm_sync(self): cmd = BYTE.pack(13) size, err, resp = self._request(cmd) if err: self.logger.warning("error arming syncs!")