feat: gui widgets supports#12
Open
Charliechen114514 wants to merge 5 commits into
Open
Conversation
GUI 接入组织级 Qt 控件库(开发期 ~/MCUUtils/QuarkWidgets,发布期 third_party/QuarkWidgets submodule)。gui/CMakeLists.txt 里 MCUUTILS_DIR 解析本地路径,缺失回退 submodule,都没有则 FATAL_ERROR 报清晰指引。 接线隔离在 gui/,根 CMakeLists 零改动(避并行 worktree 冲突热点)。 验证:MICRO_FORGE_GUI=ON 全量编译零 error;ctest 367/367 绿; micro-forge-gui offscreen(QT_QPA_PLATFORM=offscreen)启动不崩。
stm32_board_widget 那排 flat 绿/灰椭圆 LED 换成 quark::LedPanel 子控件: - 8 个 QuarkBulb(纵向;绿色保板语义「亮=引脚驱动高」)+ PA 标签 + ODR hex - setBulbSize(24×24) 适配密排;refresh() 从 odr_[0] 驱动 setLevels - resizeEvent 把 LedPanel 摆在 UART 线右侧(chip_x+kChipW+kWireLen+20) - 删 paintEvent 里手画的 PA0..PA7 rightLed lambda + 线 + 标签 - 板最小尺寸 480×420 → 600×440(腾出 LedPanel 空间) - PA9/PA10 UART + SWD + PC13 仍手画不变 验证:GUI 编译链通 + offscreen 启动不崩 + ctest 367/367;LedPanel 自身渲染已 standalone 验过(ledpanel.png)
把只读 QTextEdit(还挂着 QSS font-family:monospace,违反不用 QSS 的规矩) 换成 quark::UartTerminalView:终端体 + RX/TX 计数 + auto-scroll + 清空都现成。 适配层做的事:snapshot 每帧带的是 host 累积的整段 USART 缓冲,这里记一个 shownBytes_,只把新增的尾部 appendText 进去——保持终端「只追加」语义(它的 RX 计数和 auto-scroll 才有意义),而不是每帧整段重灌。缓冲收缩(会话 rebuild → 旧输出作废)时 clear() + shownBytes_ 归零重新对齐。 QSS 行随之删除。
板视图最后一个手画 LED(PC13 那个绿/灰椭圆)换成 quark::QuarkBulb 子控件, 和 PA 灯排统一外观/语义(同绿色「亮=引脚驱动高」)。只留引脚焊盘 + 连线 + 「PC13 / LED」文字仍手画,灯泡本身自绘。绿色 setColor + 24×24 setFixedSize, resizeEvent 摆位(芯片正下方),refresh 从 odr_[2] bit 13 驱动。删掉随之没用的 bit lambda 和 kLedR 常量。 至此板视图所有指示灯(PA0..PA7 + PC13)全部 QuarkBulb 化,无手画 LED 残留。
QuarkWidgets 仓并入了 MD3 控件库(origin/main),root 现在是 SHARED+aex 的 MD3
构建。micro-forge 只用嵌入式控件(QuarkBulb/LedPanel/UartTerminalView),所以
add_subdirectory 改指向 ${quarkwidgets_dir}/embedded,link 改 QuarkWidgets::Embedded
(target 在合并后改名避撞 MD3 的 quarkwidgets)。C++ 代码不动(命名空间 quark::、
include 目录 QuarkWidgets/ 都没变)。
验证:reconfigure + 全量编译 + ctest 367/367 + GUI offscreen 启动不崩。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.