- analyse_in_background() runs in FastAPI BackgroundTasks with its own
DB session; _in_progress set prevents duplicate concurrent analyses
- Job detail shows a spinner + auto-reloads every 3s while computing
- 'Compute now' button also triggers background analysis
- StlCache.manually_set flag (migration 0011): entries marked manual are
never overwritten by auto-analysis
- 'Override values' collapsible form on job detail lets user set
bounding box and volume directly from slicer data
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- If file exists but has no cache entry, run analyse() on page load
- If file doesn't exist on disk, show a red alert in the File & Geometry card
- Hide Download/Compute buttons when file is missing
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
queued: black + yellow outline + yellow text
printing: yellow + black text
done: green (unchanged)
cancelled: grey
failed: red (unchanged)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds depreciation/electricity as a separate line item in the production
cost breakdown. Included in the markup base so it contributes to margin.
Configurable via PRINTER_COST_PER_HOUR env var (default 0.35).
Bracket gross total updates automatically.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
POST /jobs/{id}/cancel sets status → cancelled, frees printer if printing,
logs 'Job cancelled'. Button visible in all non-terminal states (queued, printing).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- GET /files/{filename}: serves file from STL_UPLOAD_DIR with path-traversal guard
- Download button in File & Geometry card header (always visible when file attached)
- Download button also appears at the top of the Start Job modal
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The 20% infill assumption ignored walls and solid layers which dominate
most prints. Validated against Bambu Lab Studio for a GF lid:
model volume 26.09 cm³ × 0.50 × 1.24 g/cm³ = 16.2 g (actual: 16.24 g)
16.2 g / 32 g/h × 60 = 30 min (actual: 30.5 min)
New env vars (read at request time, no rebuild needed):
MATERIAL_FACTOR=0.50 fraction of model volume that becomes filament
PRINT_SPEED_G_PER_HOUR=32 matches Bambu Lab at normal quality
Card header now shows active assumptions including speed.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- POST /jobs/{id}/start: modal picks from idle/offline printers,
sets job → printing, printer → printing, logs "Job started on {name}"
- POST /jobs/{id}/stop: job → queued, clears printer_id + started_at,
printer → idle, logs "Job stopped (was on {name})"
- POST /jobs/{id}/finish: job → done, sets finished_at + duration_minutes,
printer → idle, logs "Job finished on {name}"
- Job detail shows Start / Stop+Finish buttons based on current status
- All printers currently printing are excluded from the Start printer picker
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Bracket names in the list now link directly to /jobs?bracket_id=X
- /brackets/{id} redirects to /jobs?bracket_id=X (keeps old links working)
- Bracket link on job detail page updated accordingly
- bracket_detail.html and add_jobs_to_bracket route removed
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
POST /jobs/{id}/edit updates: customer, material, color, priority, bracket,
printer, status, notes. Bracket field has '— none —' to detach from bracket.
Save auto-logs 'Job updated'. Edit button in page header.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
POST /jobs/{id}/analyse clears the stl_cache entry and re-runs trimesh,
then redirects back to the detail page. Button hidden for .gcode files.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Migration 0010: priority BOOLEAN NOT NULL DEFAULT 0 on print_jobs
- Priority jobs sort above normal jobs in the list
- Checkbox in Add Job modal; warning icon in list; badge on detail page
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Filament removal:
- Deleted app/models/filament.py, routers/filaments.py, templates/filaments.html
- Migration 0009: drops filaments table and filament_id FK from print_jobs
- Removed Filaments from sidebar and all internal references
FilamentDB integration (read-only):
- app/filamentdb.py: GET /reports/stock with 5-min in-memory cache
- available_materials() / available_colors() populate job form dropdowns
- Falls back to static constants if FilamentDB unreachable
- Dashboard filament count now from FilamentDB rolls_in_stock
- FILAMENTDB_URL added to .env.install; httpx added to requirements
Job detail page (/jobs/{id}):
- Two cards: Job info (customer, material, printer, bracket, timing, cost)
and File & Geometry (bounding box + volume from stl_cache)
- Log timeline with Add Entry modal
- Filename in jobs list links to detail page
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>