Skip to content
Merged

Dev #11

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
aca4d60
更新Web界面和API功能,添加环境工具和虚拟流功能
YihuiLu Oct 22, 2025
6d8a4be
重构调试控制台:简化代码结构,删除进度条功能
YihuiLu Oct 23, 2025
2bb8a27
全面更新项目:添加英文文档、测试脚本和Web界面优化
YihuiLu Oct 23, 2025
e536c8a
docs: 合并docs/README内容到根目录README并删除重复文件
YihuiLu Oct 23, 2025
1c2cd23
feat: 增强调试控制台文件管理功能
YihuiLu Oct 23, 2025
73cc5ae
修复 /api/debug/camera/image-quality 接口500错误 / Fix 500 error for /api/d…
YihuiLu Oct 23, 2025
e232781
更新CLAUDE提示文件,添加中英文双语提交规范和开发板调试配置 / Update CLAUDE prompt file with bil…
YihuiLu Oct 23, 2025
f1117ec
Add modern UI demo and icons, update frontend styling
YihuiLu Oct 23, 2025
829e37d
Refactor CSS structure and debug page updates
YihuiLu Oct 26, 2025
ef2dd6d
feat: 增强调试控制台相机调参与质量监控 / Enhance debug console camera tuning and qual…
YihuiLu Mar 27, 2026
967eeae
fix: 分离自动曝光与智能调整控制 / Separate auto exposure and smart tuning control
YihuiLu Mar 27, 2026
78b21af
feat: 添加调试控制台中英双语国际化 / Add bilingual i18n for debug console
YihuiLu Mar 27, 2026
f0e38bf
chore: 更新开发文档并清理历史脚本 / Update developer docs and clean legacy scripts
YihuiLu Mar 27, 2026
e1e6dfa
feat: 添加最小测试网与测试指南 / Add minimum test net and testing guide
YihuiLu Mar 27, 2026
8f670bb
style: 将所有代码注释改为中英双语格式 / Convert all code comments to bilingual (Chin…
YihuiLu Mar 27, 2026
3e39c90
refactor: 清理未使用的API路由和前端死代码 / Clean up unused API routes and frontend…
YihuiLu Mar 27, 2026
10ef3ea
fix: 为API文档添加分组标签 / Add tags for API documentation grouping
YihuiLu Mar 27, 2026
94133da
docs: 添加API文档章节并修复ReDoc空白页 / Add API documentation section and fix Re…
YihuiLu Mar 27, 2026
55a0307
feat: 增强调试系统信息接口与监控面板 / Enhance debug system info API and monitor panel
YihuiLu Mar 27, 2026
ac179ef
fix: 修复IMX327高分辨率超采样内存风险并确保模式切换生效 / Fix IMX327 high-resolution supers…
YihuiLu Mar 27, 2026
1ad1143
feat: 优化全视野分辨率切换与可视化反馈 / Improve full-FOV resolution switching and vi…
YihuiLu Mar 27, 2026
a1e4d24
Merge pull request #1 from OG-star-tech/dev-latest
YihuiLu Mar 27, 2026
3b13a35
feat: 新增星表SQLite存储与解算调试工作台 / Add SQLite-backed star catalog and plate…
YihuiLu Mar 27, 2026
0173f09
fix: 修复星表数据库损坏并内置大规模双语星库 / Fix catalog DB corruption handling and emb…
YihuiLu Mar 27, 2026
d037a18
fix: 修复调试控制台模式参数回弹与生效显示 / Fix mode option bounce-back and applied-sta…
YihuiLu Mar 27, 2026
66113c2
Merge pull request #2 from OG-star-tech/dev-latest
YihuiLu Mar 27, 2026
9a32a37
fix: 动态读取相机控制范围并修复曝光模式保存冲突 / Dynamically read camera control ranges a…
YihuiLu Mar 27, 2026
f7d27e2
fix: 优化预览抓取流水线以提升树莓派实时性 / Optimize preview pipeline to improve Raspbe…
YihuiLu Mar 27, 2026
c74ff1c
feat: 调试拍摄参数侧车与下载 / Debug capture sidecar and download
YihuiLu Mar 28, 2026
8f51836
feat: 开发板部署脚本与星图解算管线 / Board deploy scripts and plate-solve pipeline
YihuiLu Mar 28, 2026
b7b43e3
feat: 新增 OGScope 卸载脚本 / Add uninstall script
YihuiLu Mar 28, 2026
c0e78a2
docs: 补充卸载说明与中英部署文档 / Document uninstall in dev guides
YihuiLu Mar 28, 2026
f0f5f47
docs: 合并部署速查至开发指南,移除 DEPLOY 重复文档 / Merge quick deploy into README, dr…
YihuiLu Mar 28, 2026
220dbe8
feat: 开发板脚本对齐 systemd 与 Poetry venv / Align systemd ExecStart with Po…
YihuiLu Mar 28, 2026
3740fb7
feat: 同步 cedar-solve vendor 与 Tetra 提星分析链 / Sync cedar-solve vendor a…
YihuiLu Mar 28, 2026
350568c
feat: 星图解算叠加与调试页图层 / Plate solve overlay and debug layer preview
YihuiLu Mar 28, 2026
ec49630
feat: 首页 HUD 暗色主题与 Tailwind 布局 / Home HUD dark theme and Tailwind layout
YihuiLu Mar 29, 2026
3ac9210
feat: 分析 API 与星图解算调试页增强 / Analysis API and plate-solve debug page enh…
YihuiLu Mar 29, 2026
f33090b
feat: 星图解算实验室前端与扩展分析 API / Analysis lab SPA and extended analysis API
YihuiLu Mar 30, 2026
feefdbf
feat: 解算台拆分与实验记录增强 / Split analysis lab and enhance experiments
YihuiLu Mar 30, 2026
2a47bef
fix: 修复共享流并发竞态并恢复调试预览稳定性 / Fix shared-stream race conditions and rest…
YihuiLu Mar 30, 2026
63fd236
fix: 优化视频解算交互与预览可用性 / Improve video solve interactions and preview us…
YihuiLu Mar 30, 2026
b6c6834
fix: 统一录制为MP4并修复停止录制卡顿 / Switch recording to MP4 and fix stop lag
YihuiLu Mar 30, 2026
52a6b82
feat: 星空解算档位与专用线程池及分析 UI / Plate-solve profiles, solver executor, ana…
YihuiLu Mar 30, 2026
32e755e
feat: 大尺度背景减除可选流程与解算台开关 / Optional large-scale BG flattening for plat…
YihuiLu Mar 30, 2026
b226600
fix: 修复 CI 环境兼容与代码规范检查失败 / Fix CI environment compatibility and lint-…
YihuiLu Mar 30, 2026
7264b36
Merge pull request #7 from OG-star-tech/dev-latest
YihuiLu Mar 30, 2026
ef186bc
feat: 星空解算帧上传与前端抓帧解算 / Frame upload API and browser-captured solve
YihuiLu Mar 30, 2026
3352584
Merge pull request #8 from OG-star-tech/dev-latest
YihuiLu Mar 30, 2026
589159b
feat: AVI 录制与客户端转码流程 / AVI recording with client-side transcoding
YihuiLu Mar 31, 2026
99c47ac
chore: 对齐后端代码格式以通过 CI / Align backend formatting to satisfy CI
YihuiLu Mar 31, 2026
7c75f3a
fix: 稳定实时解算超时门禁单测 / Stabilize realtime timeout gate unit test
YihuiLu Mar 31, 2026
396e7fa
Merge pull request #9 from OG-star-tech/dev-latest
YihuiLu Mar 31, 2026
e7c8354
fix: 修复超时门禁单测误伤 asyncio 与间隔抖动 / Fix realtime timeout test breaking as…
YihuiLu Apr 1, 2026
7a18b1c
feat: 调试预览 MJPEG 与 native 直采降内存 / Debug MJPEG preview and native capt…
YihuiLu Apr 1, 2026
9bb7c56
feat: WiFi 切换与调试系统页及网络 API / WiFi switch, debug system page, network API
YihuiLu Apr 1, 2026
7036030
feat: 解算线程池与调试体验更新,修复 WiFi 无线解析 / Solver pool, debug/lab UX, WiFi wir…
YihuiLu Apr 2, 2026
a635be3
feat: WiFi systemd 与安装/解算部署增强 / Enhance WiFi systemd and install/solv…
YihuiLu Apr 2, 2026
0f11708
feat: 电子极轴镜 libcamera AE 预设 / Polar-scope libcamera AE preset
YihuiLu Apr 3, 2026
451008a
fix: 实时解算避免阻塞事件循环以修复长曝光预览卡顿 / Fix realtime solver blocking event loop…
YihuiLu Apr 3, 2026
0641997
fix: AP 热点 shared DHCP 与 WPA2 / AP hotspot shared DHCP and WPA2
YihuiLu Apr 3, 2026
446d228
fix: 调试页默认语言与移动端顶栏 / Debug default locale and mobile header
YihuiLu Apr 3, 2026
90dda05
refactor: 清理遗留预览代码并收紧图像链路 / Tighten image pipeline and remove legacy …
YihuiLu Apr 3, 2026
fbb2f16
feat: 统一开发者控制台 SPA 并完善相机交互 / Unify developer consoles into SPA and po…
YihuiLu Apr 3, 2026
28bb22d
feat: 修复相机控制台文件详情交互并同步构建产物 / Fix camera file detail UX and sync build…
YihuiLu Apr 3, 2026
ae80337
fix: 寻星控制台解算提示占位避免预览抖动 / Reserve gate hint slot to stop preview jitter
YihuiLu Apr 3, 2026
97baec7
chore: 增强安装/升级脚本中图案库与网络同步 / Harden install/update for plate DB and ne…
YihuiLu Apr 3, 2026
dfbcb58
fix: 修复调试素材导入转码进度卡在 18% / Fix debug import transcoding stuck at 18%
YihuiLu Apr 3, 2026
f1aa1ce
fix: Tetra3 数据库加载兼容 NumPy 2 pickle 限制 / Fix Tetra3 DB load with NumPy…
YihuiLu Apr 4, 2026
9f7e2ff
style: Black 格式化以通过 CI / Apply Black formatting for CI
YihuiLu Apr 4, 2026
bf8d67f
Merge pull request #10 from OG-star-tech/dev-latest
YihuiLu Apr 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
# 与 pyproject.toml 中 python = "^3.10" 一致 / Match Poetry python constraint
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
Expand All @@ -37,6 +38,19 @@ jobs:
- name: 安装依赖
run: poetry install --no-interaction --no-root

- name: 设置 Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: web/analysis-ui/package-lock.json

- name: 构建星空解算控制台前端
run: |
cd web/analysis-ui
npm ci
npm run build

- name: 代码格式检查 (Black)
run: poetry run black --check ogscope tests

Expand All @@ -56,6 +70,7 @@ jobs:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false # 无 CODECOV_TOKEN 的 fork 等场景不阻断 CI / Do not fail CI without token

lint:
runs-on: ubuntu-latest
Expand All @@ -65,7 +80,7 @@ jobs:
- name: 设置 Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
python-version: "3.10"

- name: 安装 Poetry
uses: snok/install-poetry@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: 设置 Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
python-version: "3.10"

- name: 安装 Poetry
uses: snok/install-poetry@v1
Expand Down
16 changes: 15 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,15 @@ env.bak/
venv.bak/
.python-version

# ====================
# Node (星图解算实验室前端 / Analysis lab UI)
# ====================
web/analysis-ui/node_modules/

# ====================
# Poetry
# ====================
poetry.lock # 在开发机和 Orange Pi 上可能不一致,建议忽略
poetry.lock # 在开发机与树莓派上可能不一致,建议忽略
.poetry/

# ====================
Expand Down Expand Up @@ -92,6 +97,12 @@ logs/
*.sqlite3
*.db-shm
*.db-wal
!data/catalog/stars.db
data/catalog/raw/*
data/catalog/index/*
data/catalog/meta/*
!data/catalog/meta/manifest.json
!data/catalog/README.md

# ====================
# 配置文件(敏感信息)
Expand Down Expand Up @@ -137,6 +148,9 @@ captured_images/
*.fits
*.fit

# Tetra3 图案库(体积大,本地或部署时放入 / Large pattern DB; copy on deploy)
data/plate_solve/default_database.npz

# 星表数据(太大,不提交)
star_catalogs/*.dat
star_catalogs/*.bin
Expand Down
80 changes: 56 additions & 24 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@

## 项目概述

OGScope 是一个基于 Orange Pi Zero 2W 的电子极轴镜系统,用于天文摄影中的精确极轴校准。
OGScope 是一个基于 Raspberry Pi Zero 2W 的电子极轴镜系统,用于天文摄影中的精确极轴校准。

## 技术栈

- **硬件**: Orange Pi Zero 2W, IMX327 相机, 2.4寸 SPI LCD
- **硬件**: Raspberry Pi Zero 2W, IMX327 相机, 2.4寸 SPI LCD
- **语言**: Python 3.9+
- **包管理**: Poetry
- **Web 框架**: FastAPI + Uvicorn
- **日志**: Loguru
- **测试**: Pytest
- **代码质量**: Black, Ruff, MyPy
- **星空解算控制台前端**: `web/analysis-ui`(Vite + React + Tailwind),构建输出 `web/static/analysis-lab/`;本地执行 `cd web/analysis-ui && npm install && npm run build`;同步到开发板见 `scripts/sync_dev_board.sh`(环境变量 `OGSCOPE_DEV_HOST`、`OGSCOPE_DEV_PATH` 等)。i18n 见 `web/static/i18n/analysis.zh.json` / `analysis.en.json`。

## 开发环境

Expand Down Expand Up @@ -59,6 +60,7 @@ ogscope/
- 类型提示: 使用 Python 类型注解
- 文档字符串: Google 风格
- 导入顺序: 标准库 → 第三方库 → 本地模块
- 注释规范: 以后新增或修改注释必须使用中英文双语(中文 / English)

## 测试标记

Expand All @@ -67,16 +69,6 @@ ogscope/
- `@pytest.mark.hardware`: 需要实际硬件的测试
- `@pytest.mark.slow`: 运行较慢的测试

## 配置管理

- 默认配置: `default_config.json`
- 环境变量: `.env` (从 `.env.example` 复制)
- 运行时配置: `ogscope/config.py` (Pydantic Settings)

## 参考项目

- **PiFinder**: 板块求解寻星器架构参考
- **OpenMV Polar Scope**: 极轴镜算法参考

## 注意事项

Expand All @@ -101,12 +93,12 @@ ogscope/
- **虚拟环境**: Poetry 管理

### 部署配置
- **生产环境**: Orange Pi Zero 2W 开发板
- **生产环境**: Raspberry Pi Zero 2W 开发板
- **测试环境**: [与生产环境相同]
- **虚拟环境目录**: [用户自定义]

### 系统服务配置
项目已配置为系统服务,服务配置文件位于 `/etc/systemd/system/ogscope.service`:
在开发板运行时项目已配置为系统服务,服务配置文件位于 `/etc/systemd/system/ogscope.service`:

```ini
[Unit]
Expand All @@ -129,6 +121,15 @@ RestartSec=3
WantedBy=multi-user.target
```

在本地运行时,使用虚拟环境,因为有些硬件只能在开发板上调用,所以本地只是代码编写,远程测试

### WiFi 与网络(NetworkManager)

- **唯一详解**见 [`docs/development/wifi-nm.md`](docs/development/wifi-nm.md):热点默认密码、`network.env`、`/debug/system`、Web API、sudoers(`ogscope-wifi` / `ogscope-nmcli`)等。
- **开机引导**:`ogscope-network-boot.service`(root oneshot,`Before=ogscope.service`)在冷启动时若 STA 长时间无可用 IPv4 则切 **AP**,不依赖 Python 进程。
- **运行时 STA 回滚**:用户通过 Web/API 切 STA 成功后,应用内按 `wifi_sta_rollback_*` 超时无 IPv4 再切回 AP;与开机引导**分工不同、不冲突**(先 boot 完成再启动 `ogscope`)。
- 二者均可能最终执行「切 AP」,行为**幂等**;不建议删除运行时回滚,否则仅冷启动有保障,**运行中**切 STA 失败后需手动恢复。

**重要说明**:
- 系统库(如 `libcamera`、`picamera2`)安装在系统环境中,通过 `PYTHONPATH` 环境变量注入到虚拟环境
- `LD_LIBRARY_PATH` 确保系统库的链接库路径正确
Expand All @@ -137,7 +138,7 @@ WantedBy=multi-user.target
### 常用命令
```bash
# 连接服务器
ssh [用户名]@[服务器地址] -p [端口]
ssh [ogstartech]@[192.168.31.16] -p [22]

# 部署到服务器
# 使用 git clone 或手动上传
Expand All @@ -159,20 +160,51 @@ python -m ogscope.main

## Git 工作流

目前还没上传到Git
- 主分支: `main` (稳定版本)
- 开发分支: `dev` (开发版本)
- 功能分支: `feature/xxx`
- 修复分支: `fix/xxx`

提交信息格式:
### 提交信息格式
**必须使用中英文双语提交信息**,格式如下:
```
feat: 添加新功能
fix: 修复bug
docs: 更新文档
style: 代码格式调整
refactor: 重构代码
test: 添加测试
chore: 构建/工具变更
中文描述 / English description

- 中文详细说明 / English detailed explanation
- 中文变更内容 / English change content
```

示例:
```
修复相机接口500错误 / Fix camera API 500 error

- 添加缺失的方法实现 / Add missing method implementations
- 重新组织服务类结构 / Reorganize service class structure
```

### 提交类型前缀
```
feat: 添加新功能 / Add new feature
fix: 修复bug / Fix bug
docs: 更新文档 / Update documentation
style: 代码格式调整 / Code style changes
refactor: 重构代码 / Refactor code
test: 添加测试 / Add tests
chore: 构建/工具变更 / Build/tool changes
```

## 开发板调试配置

### 开发板连接信息
- **IP地址**: 192.168.31.16
- **用户名**: ogstartech
- **端口**: 22
- **连接方式**: SSH

### 调试工作流程
1. **代码修改后必须上传**: 修改或新建的代码必须先上传到开发板
2. **不要遗漏文件**: 确保所有相关文件都已上传
3. **服务重启**: 项目以系统服务方式运行,修改后需要重启服务
4. **调试前确认**: 如果有不明白的地方,先询问用户再开始工作


6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

如果你发现了 bug,请:

1. 在 [Issues](https://github.com/your-username/OGScope/issues) 页面搜索是否已有相关问题
1. 在 [Issues](https://github.com/OG-star-tech/OGScope/issues) 页面搜索是否已有相关问题
2. 如果没有,创建新 Issue,包含:
- 详细的问题描述
- 复现步骤
Expand All @@ -27,7 +27,7 @@
1. **Fork 项目**
```bash
# 在 GitHub 上点击 Fork 按钮
git clone https://github.com/your-username/OGScope.git
git clone https://github.com/OG-star-tech/OGScope.git
cd OGScope
```

Expand Down Expand Up @@ -129,7 +129,7 @@
如果你在贡献过程中遇到问题:

- 查看 [开发文档](docs/development/README.md)
- 在 [Discussions](https://github.com/your-username/OGScope/discussions) 提问
- 在 [Discussions](https://github.com/OG-star-tech/OGScope/discussions) 提问
- 联系维护者

感谢你的贡献!🎉
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ lock: ## 锁定依赖版本
build: ## 构建包
poetry build

deploy: ## 部署到 Orange Pi(需要配置 SSH)
@echo "同步代码到 Orange Pi..."
deploy: ## 部署到 Raspberry Pi(需要配置 SSH 主机别名
@echo "同步代码到 Raspberry Pi..."
rsync -avz --exclude '.git' --exclude '__pycache__' --exclude '*.pyc' \
--exclude '.venv' --exclude 'PiFinder-release' \
. orangepi:~/OGScope/
Expand All @@ -69,7 +69,7 @@ logs: ## 查看日志
status: ## 查看服务状态
ssh orangepi "sudo systemctl status ogscope"

ssh: ## SSH 到 Orange Pi
ssh: ## SSH 到 Raspberry Pi(主机名见 Makefile 中 rsync 目标)
ssh orangepi

docs: ## 生成文档(如果使用 Sphinx)
Expand Down
Loading
Loading