Repository navigation
OpenDS 0.3.3
中文 | English
手柄电量上线;同时把界面布局刷新改为批量提交,页面切换和窗口缩放更跟手。
新增
手柄电量
- 概览页新增「手柄电量」卡片:电池图标、状态文字和估算百分比提示。充电时图标叠加闪电,充满显示「已充满」,异常时显示
!并附错误码。 - 实时监视画面同步绘制电量图标,与概览共用同一套几何和配色;浅色、深色、系统高对比度三种外观下都可读。电量 ≤20% 标红,21–50% 标黄,高于 50% 标绿。
- 读数取自完整蓝牙输入报文(报告
0x31)第 54 字节;兼容模式报文和含音频负载的报文不参与解析,避免把无关字节当成电量。 - 电量遥测独立于采集队列与音频重建:启停录音、复位监视器都不会清空读数。界面每 10 秒刷新一次,超过 30 秒没有新数据标记为「电量数据已过期」。
- 手柄按约 10% 档位上报电量,界面统一标注为「估算电量」,不声称精确值。
- 外观预览支持模拟电量数据,不接手柄也能核对各状态的图标、颜色和提示文案。
改进
- 子控件布局改为批量提交(
BeginDeferWindowPos):只处理尺寸或可见性真正发生变化的控件,并跳过重复的SetWindowPos,页面切换和窗口缩放的重绘开销与闪烁明显下降。 - 概览页排版按窗口宽度重算,窄窗口自动切换紧凑布局;新增电量卡片后仍保持 DPI 感知对齐。
- 主题自检新增页面切换响应测量(6 个页面 × 5 轮,输出 P95),并断言测量过程不改变窗口可见性和前台窗口。
测试与内部
- 电池验收脚本覆盖 zh-CN / en-US × 浅色 / 深色 / 高对比度 × 96 / 144 / 192 DPI 共 18 种组合,另含展开布局用例。
- 新增电报文解析与遥测单元测试,覆盖「电量不受采集启停影响」和「兼容/麦克风报文不产生读数」。
- UI 冒烟退出前等待主题压力测试的对话框全部关闭;重启类测试先等待新进程启动再清理临时 fixture,降低偶发失败。
升级说明
直接替换可执行文件和 DLL 即可,opends.ini 结构没有变化。
English
Controller battery reporting, plus a batched layout pass that makes page switching and window resizing noticeably smoother.
Added
Controller battery
- The overview now has a battery card: icon, status text and an estimated percentage tooltip. A charging bolt overlays the icon while charging, "Full" is shown when charged, and a fault state shows
!together with the error code. - The live monitor draws the same battery icon, sharing geometry and colours with the overview, and stays readable in light, dark and system high-contrast appearances. At or below 20% the meter turns red, 21–50% yellow, above 50% green.
- Readings come from byte 54 of full Bluetooth input reports (
0x31). Compatibility reports and reports carrying an audio payload are excluded, so unrelated bytes are never mistaken for battery level. - Battery telemetry is independent of the capture queue and audio rebuilds: starting or stopping recording and resetting the monitor no longer clear the reading. The UI refreshes every 10 seconds and marks the value as expired after 30 seconds without new data.
- The controller reports in roughly 10% steps, so the UI labels the value as an estimate rather than an exact figure.
- Appearance previews can inject simulated battery data, so every state can be checked without a physical controller.
Improved
- Child-control layout is now submitted as one batch (
BeginDeferWindowPos): only controls whose geometry or visibility actually changed are touched, and redundantSetWindowPoscalls are skipped. Page switching and resizing repaint far less and flicker less. - The overview recomputes its layout from the window width and switches to a compact layout in narrow windows, while keeping DPI-aware alignment with the battery card present.
- The theme self-check now measures page-switch response (6 pages × 5 rounds, P95 reported) and asserts that the measurement never changes window visibility or the foreground window.
Tests and internals
- The battery acceptance script covers zh-CN / en-US × light / dark / high contrast × 96 / 144 / 192 DPI, 18 combinations in total, plus an expanded-layout case.
- New unit tests cover report parsing and telemetry, including "battery survives capture start/stop" and "compatibility and microphone reports yield no reading".
- The UI smoke run now waits for theme-stress dialogs to close before exiting, and restart tests wait for the new process before cleaning up fixtures.
Upgrading
Replace the executable and DLLs; the opends.ini layout is unchanged.
完整变更 / Full changelog: v0.3.2...v0.3.3