добавлен парсер HEX с разбиением по FE; обрабатываем только строки 0x; D0→RAW; сегменты с F0→SYNC_DET (расчёт спектра и добавление в B‑scan), F4 в таких сегментах игнорируется; поддержка .csv и отложенный парсинг HEX для избежания SKIP по таймауту.

This commit is contained in:
2025-11-13 18:07:59 +03:00
parent 2a30e12551
commit 385c2a6dad
3 changed files with 108 additions and 39 deletions

35
AGENTS.md Normal file
View File

@ -0,0 +1,35 @@
# Repository Guidelines
## Project Structure & Module Organization
- `main.py`: Tkinter GUI for radar data analysis; watches a data folder, parses RAW/SYNC_DET/FOURIER files, and renders Bscan/Fourier views.
- `datagen.py`: Test data generator for RAW, SYNC_DET, and FOURIER; produces timestamped files to feed the GUI.
- `testLadArrayGround.m`: MATLAB scratch for algorithm experiments.
- Tests: none yet. Add under `tests/` (e.g., `tests/test_io.py`). If processing grows, factor helpers into a `processing/` package (e.g., `processing/signal.py`).
## Build, Test, and Development Commands
- Create venv: `python3 -m venv .venv && source .venv/bin/activate` (Win: `.venv\Scripts\activate`).
- Install deps: `pip install numpy scipy matplotlib`. Linux may require Tk: `sudo apt-get install -y python3-tk`.
- Run GUI: `python main.py`.
- Generate sample data: `python datagen.py` and choose 1/2/3; files go to the configured data folder.
- Run tests (when added): `pytest -q`.
## Coding Style & Naming Conventions
- Follow PEP 8 with 4space indents; add type hints for new/edited functions.
- Naming: snake_case (functions/vars), PascalCase (classes), UPPER_SNAKE_CASE (constants).
- Keep GUI logic in `main.py`; move pure processing/IO into small, testable modules.
## Testing Guidelines
- Framework: pytest (recommended). No suite exists yet.
- Naming: `tests/test_*.py`. Use temp dirs for filebased tests; dont write to system paths.
- Aim for ≥70% coverage on new modules. Add smoke tests for file parsing and queue/processing logic; use a noninteractive Matplotlib backend for tests.
## Commit & Pull Request Guidelines
- Commits: imperative mood with scope, e.g., `gui: improve Bscan update`, `datagen: add FOURIER mode`.
- PRs: include description, linked issues, reproduction steps, and screenshots/GIFs for UI changes. Keep changes focused and update docs when constants/paths change.
## Configuration Tips
- Data paths are hardcoded; update before running on nonWindows systems:
- `main.py:18``data_dir = r"D:\\data"`
- `datagen.py:11``DATA_DIR = r"D:\\data"`
- Prefer a writable local path (e.g., `/tmp/data`) and do not commit generated data.