PmuSim v0.8.1
PmuSim v0.8.1
PmuSim — PMU 主站模拟器 / PMU Master Station Simulator
🇨🇳 中国大陆用户: 首次从旧版升级若失败, 请直接从镜像下载安装包 (新版本起更新检查会自动走 proxy):
https://ghfast.top/https://github.com/Karl-Dai/PmuSim/releases/latest
🌍 Users in mainland China: if the in-app updater fails on first upgrade from a previous version, download installers from the mirror above (later versions will auto-fallback through proxies).
下载 / Downloads
下方资产里按平台选择 / Pick the asset for your platform below.
主站 PmuSim — PMU Master Station
| 平台 / Platform | 文件名 / Asset |
|---|---|
| macOS Apple Silicon | PmuSim_0.8.1_aarch64.dmg |
| macOS Intel | PmuSim_0.8.1_x64.dmg |
| Windows x64 (NSIS) | PmuSim_0.8.1_x64-setup.exe |
| Windows x64 (MSI) | PmuSim_0.8.1_x64_en-US.msi |
| Windows ARM64 (NSIS) | PmuSim_0.8.1_arm64-setup.exe |
| Linux AppImage | PmuSim_0.8.1_amd64.AppImage |
| Linux deb | PmuSim_0.8.1_amd64.deb |
| Linux rpm | PmuSim-0.8.1-1.x86_64.rpm |
子站 PmuSub — PMU Substation (data sender)
| 平台 / Platform | 文件名 / Asset |
|---|---|
| macOS Apple Silicon | PmuSub_0.8.1_aarch64.dmg |
| macOS Intel | PmuSub_0.8.1_x64.dmg |
| Windows x64 (NSIS) | PmuSub_0.8.1_x64-setup.exe |
| Windows x64 (MSI) | PmuSub_0.8.1_x64_en-US.msi |
| Linux AppImage | PmuSub_0.8.1_amd64.AppImage |
| Linux deb | PmuSub_0.8.1_amd64.deb |
| Linux rpm | PmuSub-0.8.1-1.x86_64.rpm |
Highlights / 亮点
- 📊 「上传速率」改为按数据帧 SOC/FRACSEC 报文时间戳反推,而非浏览器墙钟到达时间:消除 webview 事件循环抖动与网络挤帧导致的虚高(100Hz 流不再显示 102),读数反映子站给帧打的真实时标速率 / The master's "upload rate" is now derived from each data frame's own SOC/FRACSEC timestamp instead of browser wall-clock arrival time, eliminating the inflation from webview event-loop jitter and network bunching (a 100 Hz stream no longer reads 102) — the figure reflects the rate the substation actually time-stamped its frames at.
- 🛡️ 报文时间倒退(子站重启 / GPS 校时 / SOC 回绕)自动重置滑窗,避免旧时间戳全落入新窗造成的瞬时虚高 / A backward jump in the frame timestamp (substation restart / GPS resync / SOC wrap) now resets the sliding window, preventing the transient spike stale timestamps would otherwise cause.
- 🧪 新增 7 例 vitest 覆盖报文时间换算与帧率滑窗 / Added 7 vitest cases covering the timestamp-to-ms conversion and the frame-rate sliding window.
Added 新增
frontend/src/lib/rate.ts新增纯函数frameTimeMs(soc, fracsec, measRate):按 V3 §8.11 将 SOC/FRACSEC 换算为绝对毫秒,屏蔽 FRACSEC 高 8 位时标质量码,measRate<=0退化整秒防除零 / New pure helperframeTimeMs(soc, fracsec, measRate)infrontend/src/lib/rate.ts: converts SOC/FRACSEC to absolute milliseconds per V3 §8.11, masking the high 8 FRACSEC bits (time-quality) and degrading to whole seconds whenmeasRate<=0to avoid divide-by-zero.
Changed 改进
useFrameRate.tick改为接收数据帧报文时间(ms)而非内部读performance.now();usePmuEvents在DataFrame分支用frameTimeMs(soc, fracsec, measRate)计算时标并传入,measRate取该 IDCODE 的 CFGTIME_BASE(缺省 1e6);滑窗逻辑增加报文时间倒退检测 → 重置,停流/断链归零路径不变 /useFrameRate.ticknow takes the frame's timestamp (ms) instead of readingperformance.now()itself;usePmuEventscomputes it viaframeTimeMs(soc, fracsec, measRate)in theDataFramebranch (measRatefrom that IDCODE's CFGTIME_BASE, default 1e6); the sliding window adds backward-timestamp detection → reset, while the stop/disconnect zeroing paths are unchanged.ConfigInfoPanel最新时间戳显示复用同一frameTimeMs,消除与帧率换算两份 fracsec→ms 逻辑漂移的风险 /ConfigInfoPanel's latest-timestamp display now reuses the sameframeTimeMs, removing the risk of the two fracsec→ms conversions drifting apart.
Tests 测试
- 新增
frontend/tests/use-frame-rate.test.ts(vitest)7 场景(换算 / 高位屏蔽 / 除零 / 滑窗 / 旧帧剔除 / 倒退重置 / 清零),TDD 先红后绿;vue-tsc类型检查通过,全量前端测试 11/11 通过 / Addedfrontend/tests/use-frame-rate.test.ts(vitest), 7 scenarios (conversion / high-bit masking / divide-by-zero / window / eviction / backward-reset / clear), written test-first (red→green);vue-tscpasses and the full frontend suite is 11/11 green.
macOS 首次启动 / First launch on macOS
首次双击 .app 会被 Gatekeeper 拦截("Apple 无法验证…")。放行: 打开
系统设置 → 隐私与安全性, 滚到底点 仍要打开; 或终端执行
xattr -dr com.apple.quarantine "/Applications/PmuSim.app"。
First launch is blocked by Gatekeeper ("Apple could not verify…"). To allow:
System Settings → Privacy & Security, scroll to bottom, click Open Anyway; or
run xattr -dr com.apple.quarantine "/Applications/PmuSim.app" in Terminal.
完整变更历史 / Full changelog: CHANGELOG.md
之前版本 / Previous releases: https://github.com/Karl-Dai/PmuSim/releases