detect-gui/core/context.py
2024-11-21 11:39:52 +08:00

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