Ejemplo n.º 1
0
 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)
Ejemplo n.º 2
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
Ejemplo n.º 3
0
 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
         ))
Ejemplo n.º 4
0
 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
         )
Ejemplo n.º 5
0
 def arm_sync(self, args):
     self.sync_all()
     return BYTE.pack(0)
Ejemplo n.º 6
0
 def stop_fstopping(self):
     cmd = BYTE.pack(19)
     size, err, resp = self._request(cmd)
Ejemplo n.º 7
0
 def get_reference(self):
     cmd = BYTE.pack(16)
     size, err, resp = self._request(cmd)
     return BYTE.unpack(resp)[0]
Ejemplo n.º 8
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!")
Ejemplo n.º 9
0
 def load_walsh_table(self):
     cmd = BYTE.pack(5)
     size, err, resp = self._request(cmd)
     if err:
         self.logger.error("error loading Walsh table!")
Ejemplo n.º 10
0
 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)
Ejemplo n.º 11
0
 def arm_sync(self):
     cmd = BYTE.pack(13)
     size, err, resp = self._request(cmd)
     if err:
         self.logger.warning("error arming syncs!")