修复UCD连接错误、修改色准计算方式、修改localdiming选择方块
This commit is contained in:
@@ -432,11 +432,18 @@ def _send_ld_pattern_async(self: "PQAutomationApp", image_builder, success_msg,
|
||||
# GUI 入口(绑定为 PQAutomationApp 方法)
|
||||
# --------------------------------------------------------------------------
|
||||
def send_ld_window(self: "PQAutomationApp", percentage):
|
||||
|
||||
FIXED_WINDOW_PERCENTAGE = 40
|
||||
"""按预设按钮发送对应窗口大小,亮度取自窗口亮度输入框。"""
|
||||
|
||||
try:
|
||||
luminance_percent = float(percentage)
|
||||
window_percentage = int(float(percentage))
|
||||
if window_percentage < 1 or window_percentage > 100:
|
||||
raise ValueError
|
||||
except Exception:
|
||||
messagebox.showwarning("参数错误", "窗口范围应为 1-100")
|
||||
return
|
||||
|
||||
try:
|
||||
luminance_percent = float(self.ld_window_luminance_var.get())
|
||||
if luminance_percent < 1 or luminance_percent > 100:
|
||||
raise ValueError
|
||||
except Exception:
|
||||
@@ -450,30 +457,30 @@ def send_ld_window(self: "PQAutomationApp", percentage):
|
||||
window_level = int(round(luminance_percent / 100 * 255))
|
||||
|
||||
self.log_gui.log(
|
||||
f"发送 {FIXED_WINDOW_PERCENTAGE}%窗口(亮度{luminance_percent:.0f}%)...",
|
||||
f"发送 {window_percentage}%窗口(亮度{luminance_percent:.0f}%)...",
|
||||
level="info",
|
||||
)
|
||||
|
||||
_set_current_ld_pattern(
|
||||
self,
|
||||
"峰值亮度",
|
||||
f"{FIXED_WINDOW_PERCENTAGE}%窗口({luminance_percent:.0f}%亮度)",
|
||||
FIXED_WINDOW_PERCENTAGE,
|
||||
f"{window_percentage}%窗口({luminance_percent:.0f}%亮度)",
|
||||
window_percentage,
|
||||
)
|
||||
|
||||
def builder(width, height):
|
||||
return _ensure_window_image(
|
||||
width,
|
||||
height,
|
||||
FIXED_WINDOW_PERCENTAGE,
|
||||
window_percentage,
|
||||
window_level,
|
||||
)
|
||||
|
||||
_send_ld_pattern_async(
|
||||
self,
|
||||
builder,
|
||||
f"{FIXED_WINDOW_PERCENTAGE}%窗口({luminance_percent:.0f}%亮度)已发送",
|
||||
f"{FIXED_WINDOW_PERCENTAGE}%窗口({luminance_percent:.0f}%亮度)发送失败",
|
||||
f"{window_percentage}%窗口({luminance_percent:.0f}%亮度)已发送",
|
||||
f"{window_percentage}%窗口({luminance_percent:.0f}%亮度)发送失败",
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user