Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: Bug report
about: Report a problem
labels: bug
---

## Steps to Reproduce

## Expected

## Actual

## Logs/Screenshots

## Proposed Fix

15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: Feature request
about: Suggest an enhancement
labels: enhancement
---

## Summary

## Rationale

## Acceptance Criteria
- [ ]

## Notes

20 changes: 20 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## Summary

Briefly describe the change and why it’s needed.

## Linked Issue

Closes #<number>

## Changes
-

## Testing
- [ ] Unit tests added/updated
- [ ] `pytest -q` passes locally
- [ ] CI green

## Checklist
- [ ] Follows style (Black/Ruff)
- [ ] Docs updated (README/docs/* if needed)

34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: CI

on:
push:
branches: [ "**" ]
pull_request:
branches: [ "**" ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi

- name: Lint (ruff)
run: ruff check .

- name: Format check (black)
run: black --check .

- name: Run tests
run: pytest -q

55 changes: 55 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: PR Labeler

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
label:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v7
with:
script: |
const branch = context.payload.pull_request.head.ref;
const labels = new Set();

// Type by prefix
if (branch.startsWith('feat/')) labels.add('type: feature');
if (branch.startsWith('fix/')) labels.add('type: fix');
if (branch.startsWith('chore/')) labels.add('type: chore');

// Area by path fragment
if (branch.includes('cad-core')) labels.add('area: cad-core');
if (branch.includes('backend')) labels.add('area: backend');
if (branch.includes('frontend')) labels.add('area: frontend');
if (branch.includes('qa')) labels.add('area: qa');
if (branch.includes('integration')) labels.add('area: integration');

// Ensure labels exist
for (const name of labels) {
try {
await github.rest.issues.getLabel({
owner: context.repo.owner,
repo: context.repo.repo,
name,
});
} catch (e) {
await github.rest.issues.createLabel({
owner: context.repo.owner,
repo: context.repo.repo,
name,
color: 'ededed',
});
}
}

if (labels.size) {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
labels: [...labels],
});
}

41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Release

on:
push:
tags:
- 'v*'

jobs:
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Build (PyInstaller)
shell: pwsh
run: |
./Build_AutoFire.ps1
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: AutoFire-windows
path: dist/AutoFire/AutoFire/AutoFire.exe

release:
needs: build-windows
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: AutoFire-windows
path: artifacts
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: artifacts/AutoFire.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

44 changes: 44 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Python caches
__pycache__/
*.py[cod]
*.pyd
*.pyo
*.pyi

# Virtual environments
.venv/
venv/
env/
ENV/

# Build artifacts
build/
dist/

# Backups and temp files
*.bak
*.bak-*
*.bak_*
*.old
*.tmp
*.log

# Tool caches
.mypy_cache/
.pytest_cache/
.ruff_cache/
.coverage
.coverage.*
htmlcov/

# Editors/OS
.vscode/
.idea/
.DS_Store
Thumbs.db

# Packaging
*.egg-info/
.eggs/
*.dist-info/
pip-wheel-metadata/
19 changes: 19 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.5
hooks:
- id: ruff
args: ["--fix"]
- id: ruff-format

- repo: https://github.com/psf/black
rev: 24.8.0
hooks:
- id: black

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace

30 changes: 30 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# AutoFire – Agent Guide (HAL Lead)

Scope: Entire repository.

Principles
- Keep `main` green: all work via feature branches + PRs.
- Small, focused changes (≤300 lines) with clear rationale.
- Prefer composition over monoliths; avoid editing unrelated code.

Directory Layout (target state)
- `frontend/` – UI: Qt widgets, views, input handling.
- `backend/` – non-UI logic, persistence, loaders, settings.
- `cad_core/` – geometry kernels, tools, algorithms, units.
- `tests/` – pytest suite and tiny fixtures.
- `docs/` – architecture, decisions, and contribution guides.
- `build/` – build outputs (ignored). Packaging specs live at repo root for now.

Working Rules
- Code style: Black (line length 100) + Ruff; fix lint before commit.
- Tests: add/adjust tests with each change; no PR without tests if logic changed.
- Imports: do not rely on implicit side effects; keep module-level state minimal.
- UI vs core: GUI code stays in `frontend/`; algorithms in `cad_core/`; glue in `backend/`.

Branching
- `feat/<name>` for features, `fix/<name>` for fixes, `chore/<name>` for maintenance.
- Reference the GitHub issue number in the PR description.

Reviews
- HAL reviews and requests changes as needed. At least one human approval to merge.

2 changes: 1 addition & 1 deletion AutoFire.spec
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ a = Analysis(
pathex=['.'],
binaries=[],
datas=[('app', 'app'), ('core', 'core'), ('updater', 'updater')],
hiddenimports=['app.main', 'app.minwin', 'app.tools.array', 'app.tools.draw', 'app.tools.dimension'],
hiddenimports=['app.main', 'app.minwin', 'app.tools.array', 'app.tools.draw', 'app.tools.dimension', 'app.tools.text_tool', 'app.tools.trim_tool', 'app.tools.measure_tool', 'app.tools.extend_tool', 'app.tools.fillet_tool', 'app.tools.fillet_radius_tool', 'app.tools.rotate_tool', 'app.tools.mirror_tool', 'app.tools.scale_tool', 'app.tools.chamfer_tool', 'app.layout', 'app.dxf_import'],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
Expand Down
2 changes: 1 addition & 1 deletion AutoFire_Debug.spec
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ a = Analysis(
pathex=['.'],
binaries=[],
datas=[('VERSION.txt', '.')],
hiddenimports=['app', 'app.main', 'app.minwin', 'app.scene', 'app.device', 'app.catalog', 'app.tools', 'app.tools.draw', 'core.logger', 'core.logger_bridge', 'core.error_hook', 'updater.auto_update'],
hiddenimports=['app', 'app.main', 'app.minwin', 'app.scene', 'app.device', 'app.catalog', 'app.tools', 'app.tools.draw', 'app.tools.text_tool', 'app.tools.dimension', 'app.tools.trim_tool', 'app.tools.measure_tool', 'app.tools.extend_tool', 'app.tools.fillet_tool', 'app.tools.fillet_radius_tool', 'app.tools.rotate_tool', 'app.tools.mirror_tool', 'app.tools.scale_tool', 'app.tools.chamfer_tool', 'app.layout', 'app.dxf_import', 'core.logger', 'core.logger_bridge', 'core.error_hook', 'updater.auto_update'],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# CHANGELOG

## Unreleased (CAD Base)
- Added: DXF underlay import with layer-aware rendering and auto-fit.
- Added: Draw tools (Line, Rect, Circle, Polyline, Arc-3pt), Wire, Text.
- Added: Modify tools (Offset Selected…, Trim Lines, Extend Lines, Fillet/Corner, Fillet/Radius, Rotate, Mirror, Scale, Chamfer).
- Added: Measure tool (temporary readout).
- Added: OSNAP (Endpoint/Midpoint/Center/Intersection/Perpendicular) with toggles under View.
- Added: Export PNG/PDF (letter landscape, fit to content).
- Added: Settings menu with themes (Dark/Light/High Contrast) and improved menu contrast.
- Improved: Panning (Space or Middle Mouse), Esc commits polyline, sketch/wires included in Save/Open.
- UI: Keep Draw/Modify in menus; removed CAD toolbars from top bar; status bar shows Grid opacity and Grid size.
- Added: DXF Layers dock (visibility, color override, lock, print flags).
- Added: Command Bar (commands + coordinate entry in feet; absolute, relative, polar).
- Coverage: Placement and global/per-device overlay toggles; Candela mapping for strobes (placeholder).
- DB: SQLite catalog scaffold (auto-created at %USERPROFILE%/AutoFire/catalog.db); palette loads from DB if present and seeds demo devices.
- Annotations: MText (scalable) and Freehand sketch tool added.
- UI: Device Palette is now a dockable panel (tabbed with other docks); Properties and DXF Layers appear as tabs.
- Underlay: Added scale by reference (two picks + real distance), scale by factor, and scale by drag (anchor + live factor); respect non-print DXF layers on export; underlay transform persists with project.

## 0.5.3 – coverage + array (2025-09-08 21:04)
- Restored **Coverage** overlays:
- Detector circle
Expand Down
8 changes: 8 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Default owner (human) for all files
* @Obayne

# HAL lead for repo hygiene and CI
.github/ @Obayne
AGENTS.md @Obayne
docs/ @Obayne

Loading
Loading