修改Calman灰阶中结果图显示、修改UI主题样式应用
This commit is contained in:
@@ -272,6 +272,49 @@ def disconnect_com_connections(self: "PQAutomationApp"):
|
||||
self.connection.disconnect_all()
|
||||
|
||||
|
||||
def _get_ca_measure_lock(self: "PQAutomationApp"):
|
||||
lock = getattr(self, "_ca_measure_lock", None)
|
||||
if lock is None:
|
||||
lock = threading.RLock()
|
||||
self._ca_measure_lock = lock
|
||||
return lock
|
||||
|
||||
|
||||
def _read_ca_display(self: "PQAutomationApp", mode: int):
|
||||
"""在锁内切换 CA410 Display 模式并立即读取,避免模式串扰。"""
|
||||
if getattr(self, "ca", None) is None:
|
||||
raise RuntimeError("请先连接 CA410 色度计")
|
||||
|
||||
with _get_ca_measure_lock(self):
|
||||
self.ca.set_Display(mode)
|
||||
return self.ca.readAllDisplay()
|
||||
|
||||
|
||||
def read_ca_xyLv(self: "PQAutomationApp"):
|
||||
"""读取 xy/Lv/XYZ(Display 0)。"""
|
||||
return _read_ca_display(self, 0)
|
||||
|
||||
|
||||
def read_ca_tcp_duv(self: "PQAutomationApp"):
|
||||
"""读取 Tcp/duv/Lv/XYZ(Display 1)。"""
|
||||
return _read_ca_display(self, 1)
|
||||
|
||||
|
||||
def read_ca_uvLv(self: "PQAutomationApp"):
|
||||
"""读取 u'/v'/Lv/XYZ(Display 5)。"""
|
||||
return _read_ca_display(self, 5)
|
||||
|
||||
|
||||
def read_ca_xyz(self: "PQAutomationApp"):
|
||||
"""读取 XYZ(Display 7)。"""
|
||||
return _read_ca_display(self, 7)
|
||||
|
||||
|
||||
def read_ca_lambda_pe(self: "PQAutomationApp"):
|
||||
"""读取 λd/Pe/Lv/XYZ(Display 8)。"""
|
||||
return _read_ca_display(self, 8)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"ConnectionController",
|
||||
# 兼容层
|
||||
@@ -298,3 +341,10 @@ class DeviceConnectionMixin:
|
||||
check_port_connection = check_port_connection
|
||||
enable_com_widgets = enable_com_widgets
|
||||
disconnect_com_connections = disconnect_com_connections
|
||||
_get_ca_measure_lock = _get_ca_measure_lock
|
||||
_read_ca_display = _read_ca_display
|
||||
read_ca_xyLv = read_ca_xyLv
|
||||
read_ca_tcp_duv = read_ca_tcp_duv
|
||||
read_ca_uvLv = read_ca_uvLv
|
||||
read_ca_xyz = read_ca_xyz
|
||||
read_ca_lambda_pe = read_ca_lambda_pe
|
||||
|
||||
Reference in New Issue
Block a user