屏模组添加colorinfo设置、修改配置项UI样式

This commit is contained in:
xinzhu.yin
2026-05-28 10:20:17 +08:00
parent c63b9ef615
commit f8f2d471e5
8 changed files with 752 additions and 155 deletions

View File

@@ -30,15 +30,52 @@ class PatternService:
source_params = self._get_source_pattern_params(mode)
if test_type == "screen_module":
screen_cfg = self.app.config.current_test_types.get("screen_module", {})
color_space = (
self.app.screen_module_color_space_var.get()
if hasattr(self.app, "screen_module_color_space_var")
else screen_cfg.get("colorimetry", "sRGB")
)
data_range = (
self.app.screen_module_data_range_var.get()
if hasattr(self.app, "screen_module_data_range_var")
else screen_cfg.get("data_range", "Full")
)
bit_depth = (
self.app.screen_module_bit_depth_var.get()
if hasattr(self.app, "screen_module_bit_depth_var")
else f"{int(screen_cfg.get('bpc', 8))}bit"
)
output_format = (
self.app.screen_module_output_format_var.get()
if hasattr(self.app, "screen_module_output_format_var")
else screen_cfg.get("color_format", "RGB")
)
if log_details:
self._log("=" * 50, "separator")
self._log("设置屏模组信号格式:", "info")
self._log("=" * 50, "separator")
self._log(
f" Timing: {self.app.config.current_test_types[test_type]['timing']}",
"info",
)
for label, value in [
("色彩空间", color_space),
("色彩格式", output_format),
("数据范围", data_range),
("编码位深", bit_depth),
("Timing", self.app.config.current_test_types[test_type]["timing"]),
]:
self._log(f" {label}: {value}", "info")
self.app.signal_service.apply_config(active_config)
success = self.app.signal_service.update_signal_format(
color_space=color_space,
data_range=data_range,
bit_depth=bit_depth,
output_format=output_format,
)
if log_details:
self._log(
f"屏模组信号格式设置{'成功' if success else '失败'}",
"success" if success else "error",
)
elif test_type == "sdr_movie":
data_range = self.app.sdr_data_range_var.get()