当前位置: 首页>>代码示例>>Python>>正文


Python MainWindow.update_gps_table方法代码示例

本文整理汇总了Python中gui.MainWindow.update_gps_table方法的典型用法代码示例。如果您正苦于以下问题:Python MainWindow.update_gps_table方法的具体用法?Python MainWindow.update_gps_table怎么用?Python MainWindow.update_gps_table使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gui.MainWindow的用法示例。


在下文中一共展示了MainWindow.update_gps_table方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_gui_main_window

# 需要导入模块: from gui import MainWindow [as 别名]
# 或者: from gui.MainWindow import update_gps_table [as 别名]
	def test_gui_main_window(self):
		from gi.repository import Gtk
		try:
			from .config import Config
			from .map import Map
			from .gui import MainWindow
		except SystemError:
			from config import Config
			from map import Map
			from gui import MainWindow
		def dummy():
			return
		
		test_config = Config(None).default_config
		test_map = Map(test_config["map"])
		test_networks =  networks()
		
		main_window = MainWindow(test_config, dummy, dummy, test_map, test_networks, None, None)
		main_window.network_list.crypt_cache = {}
		
		main_window.log_list.add("test")
		main_window.network_list.network_selected = "11:22:33:44:55:66"
		main_window.network_list.add_network('00:12:2A:03:B9:12')
		main_window.network_list.add_network('00:12:2A:03:B9:12')
		main_window.network_list.remove_network('00:12:2A:03:B9:12')
		main_window.update_info_table({"networks":100, "packets":200})
		main_window.update_gps_table({"fix": 3, "lat": 52.0, "lon": 13.0})
		sources = {"1": {"uuid": "1", "username": "test", "type": "bla",
			"channel": 11, "packets": 100}}
		main_window.update_sources_table(sources)
		main_window.on_configure_event(None, None)
		main_window.on_config_window(None)
		main_window.on_config_window(None)
		main_window.on_signal_graph(None)
		main_window.on_signal_graph_destroy(None, "11:22:33:44:55:66")
		main_window.fullscreen()
		main_window.fullscreen()
		main_window.on_map_window(None, True)
		main_window.on_map_window(None, False)
		main_window.on_map_widget(None, True)
		main_window.on_map_widget(None, False)
		main_window.on_client_disconnect(None)
		test_event = TestEvent()
		main_window.on_window_state(None, test_event)
		
		test_widget = TestWidget()
		config_window = main_window.config_window
		
		main_window.on_file_import(None)
		
		test_widget.text = "Infrastructure"
		main_window.on_network_filter_type(test_widget)
		main_window.on_network_filter_networks(test_widget, "map", "all")
开发者ID:vaginessa,项目名称:kismon,代码行数:55,代码来源:test.py

示例2: __init__

# 需要导入模块: from gui import MainWindow [as 别名]
# 或者: from gui.MainWindow import update_gps_table [as 别名]

#.........这里部分代码省略.........
		self.sources = {}
		self.init_client_thread()
		if "--load-kismet-dump" in sys.argv:
			self.client_thread.client.load_dump(sys.argv[2])
		self.client_thread.start()
		
	def client_stop(self):
		self.client_thread.stop()
		
	def queue_handler(self):
		if self.main_window.gtkwin is None:
			return False
			
		if len(self.client_thread.client.error) > 0:
			for error in self.client_thread.client.error:
				self.main_window.log_list.add(error)
			self.client_thread.client.error = []
		
		#gps
		gps = None
		fix = None
		gps_queue = self.client_thread.get_queue("gps")
		while True:
			try:
				data = gps_queue.pop()
				if gps is None:
					gps = data
				if data["fix"] > 1:
					fix = (data["lat"], data["lon"])
					break
			except IndexError:
				break
		if gps is not None:
			self.main_window.update_gps_table(gps)
			if fix is not None and self.map is not None:
				self.map.set_position(fix[0], fix[1])
		
		#status
		for data in self.client_thread.get_queue("status"):
			self.main_window.log_list.add(data["text"])
		
		#info
		info_queue = self.client_thread.get_queue("info")
		try:
			data = info_queue.pop()
			self.main_window.update_info_table(data)
		except IndexError:
			pass
			
		#source
		update = False
		for data in self.client_thread.get_queue("source"):
			uuid = data["uuid"]
			if uuid == "00000000-0000-0000-0000-000000000000":
				continue
			self.sources[uuid] = data
			
			update = True
		if update is True:
			self.main_window.update_sources_table(self.sources)
		
		return True
		
	def queue_handler_networks(self):
		#ssid
		for data in self.client_thread.get_queue("ssid"):
开发者ID:vaginessa,项目名称:kismon,代码行数:70,代码来源:core.py


注:本文中的gui.MainWindow.update_gps_table方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。