Repository navigation
Conversation
- 帧率只有 15 / 30 / 60 三档(默认 60)。命令行 set / create --fps、MCP、HTTP 接口给了别的值不报错,落到一档(31–59 取 30,16–29 取 15,1–14 取 15,高于 60 取 60):create 在日志里说一行,set 放进结果的 warnings(--json 结构不变);0 和负数照旧报参数错。 - 已有实例的旧值(36、45 这类)在每次开机写显示设置之后、起模拟器之前改写 config.ini 的 hw.lcd.vsync,日志记一行「帧率 36 已调整为 30」;写不进只记日志,照原值开机。list、info 和界面一律显示调整后的值。 - 管理器的新建和设置把数字框加滑条换成三档选择,提示写明各档适合什么。 - README、HTTP API 文档、命令行帮助、MCP 说明一起改;AUTO-MAS 对照用的 Python 参考同步新规则。 Refs ModAVD/ModAVD#286
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.
实例帧率只给 15 / 30 / 60 三档,默认 60(ModAVD/ModAVD#286「定下来的做法」)。
改了什么
avd.SnapFPS):60 及以上取 60,30–59 取 30,1–29 取 15。也就是 31–59 → 30、16–29 → 15、1–14 → 15、高于 60 → 60(原来上限 60,超过报错;现在落到 60)。0 和负数照旧是参数错误(帧率只能是 15、30 或 60)。modavd create --fps/set --fps、MCP 的create_instance/update_instance、HTTP 的POST /api/instances/PATCH /api/instances/{i}都走avd.ValidateFPS,不在三档里的不报错,落到一档写进去:set:结果的warnings里多一行「帧率 36 已调整为 30(只有 15 / 30 / 60 三档)」,普通输出在「已修改实例 3:帧率 30」下面打出来;--json用的是已有的warnings字段,结构不变。create:返回的实例就是 30,日志(命令行的 stderr)记一行同样的话;create的结果本来没有 warnings,没加字段。fps去掉了maximum: 60,说明改成三档和取整规则,免得客户端按 schema 先把 61 拦掉。launchPlanFor里,写完显示设置(avd.ApplyDisplay)之后、起模拟器之前跑avd.ApplyFPS:config.ini 的hw.lcd.vsync不在三档里就原地改成取整后的值,日志记「实例 N 的帧率 36 已调整为 30(只有 15 / 30 / 60 三档),已写入 config.ini」。所有开机(start、新建的初始化、执行桥的冷启动)都经过这里。没有这一项、是 0 或读不出数的不动(模拟器按 60 Hz 开机)。写不进只记一行警告、照原值开机,不挡开机。帧率只记在 config.ini,mas-avd.json里没有,所以只改这一处。Instance.FPS()读的时候就按同样的规则取整,所以开机前list、info、界面显示的已经是调整后的值。TestCatalog过。[--fps 15|30|60]、--fps的说明)一起改;dev/mock.js照服务端的规则取整。changelog.d/286-fps-steps.change.md。AUTO-MAS 侧现状(只读看的 GitHub)
avd/constants.py里FPS_CHOICES = (30, 60)、DEFAULT_FPS = 60。新建时validate_fps只收 30 / 60,再以modavd create --fps传过来;改设置时用的是通用的settings.py范围检查,fps允许 1–240,再以modavd set --fps传过来。前端DeviceSettings.vue也是fps1–240。app/utils/emulator2/avd/(直接写 config.ini,同样只给 30 / 60)在 dev 上已由 refactor(avd): ModAVD 全部改由 modavd 命令行控制,移除自带的直控和更新器 AUTO-MAS-Project/AUTO-MAS#1918 换成调 modavd 命令行,main 上还留着旧代码;它写的 30 / 60 也都在三档里。测试
TestValidateOptions里取整规则的边界:1、14、15、16、29、30、31、36、45、59、60、61、120,以及 0、-1 报错。TestApplyFPS:36、45、59、31、29、16、14、1、61、120 原地改写(其余行不动)、再跑一次不写;60、30、15、0、没有这一项、abc、-5 不动。TestLaunchPlanFPS(假 adb、临时根):config.ini 写成 36,开机准备后变 30、日志一行,第二次开机不再记,list显示 30。TestOpsFPSSteps:create 36 → 30 并记日志;update 45 / 14 / 61 → 30 / 15 / 60 并带 warnings,30 不带,0 报错。TestFormatUpdateAndOthers:set 的普通输出带调整说明。testdata/instances_ref.py)同步新规则,TestCreateUpdateDeleteMatchPython加了 61 / 36 / 14 / -1 的 create 和 61 / 0 的 update。scripts/test_create_cancel.mjs):设置里三档、默认 60、选 30 只 PATCH{fps: 30};实例是 15 时选中 15、没改不能保存;新建对话框同样三档、默认 60、选 15 时 POST 的fps是 15。v >= 30改成v > 30;v >= 60改成v >= 61;1–29 落 15 改成原样返回;ApplyFPS不写 config.ini;launchPlanFor不调ApplyFPS;update 不带 warnings;create 不记日志。界面去掉 15 那一档也会让 node 测试失败。-skip TestProductionRootReadOnly)、全部 node 界面测试、scripts/repo_checks.py都过了。go test ./internal/emu里TestClone*三个在本机失败:本机 20010–20012 被正在运行的实例占着,复制挑到了编号 2;不改动的 upstream/main 上同样失败,和这个 PR 无关。Refs ModAVD/ModAVD#286