mirror of
http://git.xinwangdao.com/cnnc-embedded-parts-detect/detect-gui.git
synced 2025-06-24 05:04:12 +08:00
26 lines
499 B
Python
26 lines
499 B
Python
|
|
|
|
class AppContext:
|
|
"""
|
|
存放一些全局服务对象
|
|
"""
|
|
# 显示比例
|
|
_display_ratio = 1
|
|
# EdgeContext
|
|
_edge_context = None
|
|
|
|
@staticmethod
|
|
def set_ratio(ratio):
|
|
AppContext._display_ratio = ratio
|
|
|
|
@staticmethod
|
|
def get_ratio():
|
|
return AppContext._display_ratio
|
|
|
|
@staticmethod
|
|
def set_edge_context(ctx):
|
|
AppContext._edge_context = ctx
|
|
|
|
@staticmethod
|
|
def get_edge_context():
|
|
return AppContext._edge_context |