修改calman灰阶点击异常、修改色准结果显示异常
This commit is contained in:
@@ -21,8 +21,23 @@ class PatternService:
|
||||
def __init__(self, app):
|
||||
self.app = app
|
||||
|
||||
def _build_apply_config_error(self, test_type):
|
||||
timing = self.app.config.current_test_types.get(test_type, {}).get("timing", "-")
|
||||
detail = ""
|
||||
try:
|
||||
ctrl = getattr(self.app.signal_service.device, "raw_controller", None)
|
||||
if ctrl is not None:
|
||||
d = getattr(ctrl, "last_error", None)
|
||||
if d:
|
||||
detail = f", detail={d}"
|
||||
except Exception:
|
||||
pass
|
||||
return f"UCD profile apply_config failed for {test_type}, timing={timing}{detail}"
|
||||
|
||||
def prepare_session(self, mode, *, test_type=None, log_details=False):
|
||||
test_type = test_type or self.app.config.current_test_type
|
||||
if hasattr(self.app.config, "set_current_test_type"):
|
||||
self.app.config.set_current_test_type(test_type)
|
||||
if not self.app.config.set_current_pattern(mode):
|
||||
raise ValueError(f"未知的图案模式: {mode}")
|
||||
|
||||
@@ -64,7 +79,8 @@ class PatternService:
|
||||
("Timing", self.app.config.current_test_types[test_type]["timing"]),
|
||||
]:
|
||||
self._log(f" {label}: {value}", "info")
|
||||
self.app.signal_service.apply_config(active_config)
|
||||
if not self.app.signal_service.apply_config(active_config):
|
||||
raise RuntimeError(self._build_apply_config_error(test_type))
|
||||
success = self.app.signal_service.update_signal_format(
|
||||
color_space=color_space,
|
||||
data_range=data_range,
|
||||
@@ -97,7 +113,10 @@ class PatternService:
|
||||
active_config = self.app.config.get_temp_config_with_converted_params(
|
||||
mode=mode, converted_params=converted_params
|
||||
)
|
||||
self.app.signal_service.apply_config(active_config)
|
||||
if hasattr(active_config, "set_current_test_type"):
|
||||
active_config.set_current_test_type(test_type)
|
||||
if not self.app.signal_service.apply_config(active_config):
|
||||
raise RuntimeError(self._build_apply_config_error(test_type))
|
||||
success = self.app.signal_service.update_signal_format(
|
||||
color_space=self.app.sdr_color_space_var.get(),
|
||||
data_range=data_range,
|
||||
@@ -129,7 +148,10 @@ class PatternService:
|
||||
active_config = self.app.config.get_temp_config_with_converted_params(
|
||||
mode=mode, converted_params=converted_params
|
||||
)
|
||||
self.app.signal_service.apply_config(active_config)
|
||||
if hasattr(active_config, "set_current_test_type"):
|
||||
active_config.set_current_test_type(test_type)
|
||||
if not self.app.signal_service.apply_config(active_config):
|
||||
raise RuntimeError(self._build_apply_config_error(test_type))
|
||||
success = self.app.signal_service.update_signal_format(
|
||||
color_space=self.app.hdr_color_space_var.get(),
|
||||
data_range=data_range,
|
||||
|
||||
Reference in New Issue
Block a user