Skip to content

EGoTouchRev v1.0.4

Choose a tag to compare

@awarson2233 awarson2233 released this 20 May 14:58
· 424 commits to main since this release

EGoTouchRev-rebuild 升级日志

本版本对 EGoTouchRev-rebuild 进行了深度的架构重构与功能扩展,主要聚焦于手写笔(Stylus)与触摸(Touch)信号处理流水线的模块化重构、VHF 虚拟 HID 注入服务、基于共享内存的三缓冲区 IPC 机制以及全新的 ImGui 诊断工作台 (Diagnostics Workbench)。


🏗️ 整体架构演进

自 v1.0.3 以来,系统已逐步从原有的混合耦合架构演进为高内聚、低耦合的模块化数据流管道。下图展示了当前的系统核心架构与数据流向:

graph TD
    subgraph HW["硬件与数据采集层"]
        Himax["Himax 芯片通信"] -->|原始帧数据| Pipelines
    end

    subgraph Pipelines["核心数据流水线"]
        direction TB
        subgraph TouchPipeline["触摸流 (Touch Pipeline)"]
            T_Cond["信号调理"] --> T_Feat["特征提取"]
            T_Feat --> T_Track["手势/触控追踪"]
            T_Track --> T_SIMD["SIMD加速解算器"]
        end
        subgraph StylusPipeline["手写笔流 (Stylus Pipeline)"]
            S_Filter["线性滤波器 LinearFilter"] --> S_Tilt["倾斜估计 TiltProcess"]
            S_Tilt --> S_Press["压力解算器 PressureSolver"]
            S_Press --> S_Edge["边缘检测与锁定"]
        end
    end

    subgraph Service["核心服务与驱动注入层"]
        ServiceHost["ServiceHost 服务宿主"] --> DeviceRuntime["DeviceRuntime 状态监控"]
        ServiceHost --> VhfReporter["VhfReporter HID注入"]
        VhfReporter -->|Win32 合成笔事件| OS["Windows 系统"]
    end

    subgraph DiagnosticsLayer["诊断与 IPC 交互层"]
        IPC["共享内存三缓冲区 IPC"] <--> Diagnostics["DiagnosticsWorkbench 诊断工作台"]
        Diagnostics -->|ImGui UI 渲染| ConfigUI["ConfigUIRenderer 配置界面"]
    end

    Pipelines -->|处理后状态| ServiceHost
    Pipelines -->|遥测数据| IPC


🚀 主要特性与改进

1. 模块化与高性能手写笔处理流水线 (Stylus Processing Pipeline)

重构了整个手写笔输入流,实现了高精度的坐标、压感和倾斜度解算:

  • 倾斜度估算 (Tilt Estimation):引入 TiltProcess 模块,通过 TX1 和 TX2 物理通道的坐标特征精确估算手写笔倾斜度。
  • 输入平滑与稳定 (Linear Filtering):实现 LinearFilterProcess 线性滤波器,有效消除高频物理抖动,并配备了完整的单元测试进行验证。
  • 坐标修正与边缘锁定:增加了手写笔边缘检测与坐标校正逻辑,有效解决屏幕边缘的漂移和跳跃问题。
  • 压感解算与噪声抑制:重构了手写笔压力解算器,支持信号噪声抑制与网格峰值检测(Grid Peak Detection)。

2. VHF 虚拟 HID 笔事件注入与运行时服务 (Service Host & VHF)

为了实现向操作系统的硬件级手写笔事件注入,引入了全新的驱动级注入支持:

  • VhfReporter HID 注入:实现了基于 VHF (Virtual HID Framework) 的报告器,能够向 Windows 系统发送原生的手写笔/触控报告包。
  • Win32 笔按钮合成注入:支持手写笔侧边物理按键的 Win32 事件合成与注入管道。
  • 解耦的 Service Host 架构:建立了独立的 ServiceHost 进程和 IPC 代理(IPC Proxy),实现了底层服务与上层诊断 UI 的进程级解耦。
  • DeviceRuntime 管理:规范化了 Himax、VHF 与手写笔物理设备链的生命周期管理与系统状态监控。

3. 高性能共享内存三缓冲区 IPC

设计并实现了一套低延迟、无锁化的进程间通信机制,用于传输高频触控遥测数据:

  • Triple-Buffer IPC:采用共享内存三缓冲区技术,确保诊断 UI 在读取高频帧数据时不阻塞核心数据流水线。
  • 规范化配置控制协议 (Canonical IPC Config Contract):引入了规范的 IPC 配置控制协议,支持在运行期动态下发配置和修改流水线参数。

4. 停靠式诊断工作台 (Diagnostics Workbench UI)

大幅升级了开发调试工具链,提供专业级别的实时遥测与调试界面:

  • ImGui 升级与停靠布局 (Docking):升级了 ImGui 核心,支持停靠和多窗口管理。
  • 实时遥测可视化:支持在 UI 中实时绘制触控点轨迹、传感器网格峰值、手写笔压力曲线与倾斜度变化。
  • 服务状态与模式切换:支持在诊断 UI 中直观展示当前服务模式的“期望状态”与“实际激活状态”(Desired vs Active Service Mode),便于快速排查配置冲突。

5. 触摸流水线优化与 SIMD 加速

  • SIMD 加速解算器:利用 SIMD 指令集加速触摸特征提取和坐标解算,显著降低 CPU 占用。
  • 手势状态机:设计并实现了全新的手势状态机逻辑,使多指手势识别更加精准。

🛠️ 重构与代码质量提升

  • Header-only 迁移:将核心的 Touch/Stylus 数据流水线重构为 header-only 模块,极大地提高了编译速度和跨平台(MSVC/MinGW)分发便利性。
  • 解耦测试:重构了测试套件,解耦了手写笔测试与具体的帧状态,清理了过时的断言,使 CI/CD 单元测试更加稳定。
  • 冗余清理:移成了过时且未使用的 legacy 释放状态镜像(release state mirrors)和 stylus packet builder,精简了核心代码库。
  • MinGW 兼容:修正在 MinGW 环境下编译 Unicode 入口服务的链接配置。

📋 提交日志分类汇总 (Commit Logs)

Features & New Architectures (新功能与新架构)

  • 9c8f2d4 feat: implement DeviceRuntime management and system state monitoring logic
  • f8585b4 feat: implement stylus coordinate correction and Win32 synthetic pen button injection pipeline
  • 6e04be0 feat: implement stylus solver components and add build-time debugging symbols for MSVC
  • a16a70b feat: implement stylus coordinate processing pipeline with edge detection and lock logic
  • 3a7ed03 feat: implement VhfReporter for HID injection and integrate into ServiceHost
  • 05744a2 feat: implement service host and IPC proxy for decoupled service management
  • f3e5563 feat: implement modular stylus solver components and device runtime handlers
  • b5c4644 feat: add stylus pipeline processing modules and reporting helper structures
  • ef781f6 feat: implement stylus tilt processing pipeline and coordinate revision logic
  • 6dc414e feat: implement modular stylus processing pipeline with configurable solver stages and testing support
  • d80bc03 feat: implement stylus pipeline with pressure, tilt, and filtering solvers and add service host infrastructure
  • 53ffc98 Add TiltProcess class for estimating stylus tilt based on TX1 and TX2 coordinates
  • 320769c feat: implement LinearFilterProcess to stabilize stylus input and add corresponding unit tests
  • d167654 feat: implement stylus linear filtering and post-processing pipeline with associated unit tests
  • ebc5dc0 feat: implement linear stylus coordinate filter and supporting solver infrastructure
  • 2f2c24e feat: show desired vs active service mode in diagnostics UI
  • 3e5b539 feat: harden pen, VHF, and himax device chain
  • fc27807 feat: normalize system state lifecycle handling
  • 5743625 feat: introduce canonical IPC config control contract
  • aaab4aa feat: implement shared memory triple-buffer IPC and system state monitoring infrastructure
  • f433832 feat: implement DiagnosticsWorkbench UI with docking layout, service proxy integration, and real-time telemetry visualization
  • 5aa2c89 feat: implement stylus pressure solver, signal suppression, and grid peak detection pipeline
  • 258c9f5 feat: implement TouchTracker and StylusPipeline modules for improved touch and stylus input processing
  • 390d48d feat: implement diagnostics workbench and service runtime architecture for touch pipeline analysis
  • 1ced345 feat: implement Himax chip communication, stylus/touch pipelines, and TSAPrmt export tool
  • a62e572 feat: implement stylus suppression and touch pipeline configuration serialization with supporting tests
  • 78a6494 feat: implement high-performance touch processing pipeline with SIMD-accelerated solver modules and benchmark tools
  • cb2184c feat: implement modular TouchPipeline architecture and add supporting signal processing modules
  • 9a73b18 feat: implement modular touch processing pipeline with signal conditioning, feature extraction, and tracking logic
  • 644a741 feat: implement ConfigUIRenderer for ImGui and establish core TouchPipeline processing logic
  • 2dee8a4 feat: implement stylus processing pipeline with coordinate solving and state management
  • 3376707 feat: implement stylus coordinate revision pipeline with tilt-based compensation logic

Refactorings & Optimizations (重构与优化)

  • 4feaee8 refactor: drop legacy stylus release state mirrors
  • bbd6ac1 refactor: soften stylus legacy ui diagnostics coupling
  • 85561a2 refactor: isolate vhf stylus dispatch packet
  • b5f4691 refactor: promote stylus frame parser naming
  • 9d268a5 refactor: inline stylus diagnostics snapshot
  • 4a595f6 refactor: drop unused stylus packet builder
  • 222c293 refactor: switch TouchTracker to stylus interop contract
  • 316069f refactor: move stylus VHF packet assembly into reporter
  • 989cddd refactor: add stylus frame contract bridge
  • 073292b refactor: migrate touch and stylus processing pipelines to header-only modules and implement gesture state machine logic
  • 34cbbc5 feat: update stylus and touch solver behavior gates
  • ff2f800 feat: upgrade imgui

Bug Fixes & Refinements (问题修复与细节调整)

  • 9901263 fix: guard peak access in non-diagnostic builds
  • 52d573a build: link service unicode entry on mingw
  • a7f49ad chore: remove obsolete and unused files from the codebase

Tests & Documentation (测试与文档)

  • fd7841b test: decouple stylus modules test from frame state
  • 55a27a0 test: drop stylus solver packet assertions
  • f5057e2 test: align stylus diag contract coverage
  • 1921e40 Add detailed analysis of LinearFilterProcess module in TSACore.dll
  • 37a7ab3 docs: add stylus touch-mirror rebuild design
  • c84e255 docs: refresh architecture and clean legacy reverse notes