コード例 #1
0
ファイル: discovery.py プロジェクト: G3UKB/SdrN
	def __init__(self):
		""" Constructor """
		
		super(DiscoverThrd, self).__init__()

		self.__logger = logging.getLogger('sdrn.discover')
		self.__msg_callback = instance_cache.getInstance(UI_MSG)
		
		# Set numpy to print in hex for easier debugging
		#np.set_printoptions(formatter={'int':hex})
		
		# Discover request packet
		# 0-3 	sequence no (always set to zero)
		# 4 	command byte (0x02)
		# 5..59	zero
		self.__discovery_request = np.zeros((HPSDR_DISCOVER_RQST_SIZE), dtype=np.ubyte)
		self.__discovery_request[4] = 0x02	# Command discovery
		
		# Discover reply packet
		self.__discovery_reply = np.zeros((HPSDR_DISCOVER_RPLY_SIZE), dtype=np.ubyte)
		
		# Class vars
		self.__terminate = False	# True when terminating
		self.__hpsdr_units = 0		# Count of discovered units
		
		# Wait event
		self.__wait_event = threading.Event()
コード例 #2
0
ファイル: discovery_ui.py プロジェクト: G3UKB/SdrN
 def __reset(self):
     """ Do another scan """
     
     self.__resetBtn.setEnabled(False)
     instance_cache.getInstance(DISCOVER).reset()