Part-DB-server/docs
Sebastian Almberg d73bc42362 Add a component value calculator & image generator
Adds a "Value calculator" tool (Tools menu) that decodes/encodes the value of
common components and generates a clean SVG picture you can attach to a part —
handy for assortments imported with blank thumbnails and sparse data.

Calculator tabs (bidirectional decode <-> encode), each drawing the part to the
selected package with a collapsible appearance panel and an "attach to part"
action (optionally as the master picture):
- Resistor: 4/5/6-band colour code
- Capacitor: value <-> 3-digit code <-> tolerance
- SMD resistor: value <-> 3-digit / 4-digit / EIA-96 code
- Inductor: colour-band code
- SMD inductor: value <-> uH code

Bulk "Generate component images" parts-table action:
- Classifies each selected part (resistor / capacitor / inductor / diode / LED,
  THT or SMD) with ComponentValueGuesser and detects value, voltage, tolerance,
  power, ppm, pitch, diameter, colour, SMD package and marking from the name,
  description and parameters.
- Renders a preview per part, lets you tweak appearance, and attaches the images
  in one go; can also write matching KiCad symbol/footprint/reference-prefix EDA
  fields.

Backend: ComponentValueGuesser (classification + detection + EDA suggestion),
GeneratedImageAttachmentHelper (stores the SVG through the existing attachment
pipeline, so it is sanitised on save), two POST endpoints on PartController
(generate_image, set_eda) guarded by `edit` + CSRF, a new `@tools.value_calculator`
permission, a Tools-tree entry and docs. All drawing is client-side in a Stimulus
controller; the un-sanitised live preview escapes part-derived text and validates
colours as defence-in-depth.

Tests: unit tests for ComponentValueGuesser and functional tests for the
endpoints, including permission and CSRF enforcement and the persisted side
effects.
2026-07-30 17:49:18 +02:00
..
api Improve documentation clarity and fix outdated information (#1129) 2025-12-06 22:40:45 +01:00
assets Update example import csv to schow real capatibilities 2025-08-31 22:13:54 +02:00
installation Use debian 13 with php8.4 as base for direct debian installation 2026-07-19 22:07:40 +02:00
screenshots Add Update Manager screenshot for PR 2026-01-30 23:36:08 +01:00
upgrade Updated documentation about node requirements 2026-04-03 21:58:02 +02:00
usage Add a component value calculator & image generator 2026-07-30 17:49:18 +02:00
.gitignore Improved documentation 2023-02-08 00:52:45 +01:00
_config.yaml Improved documentation 2023-02-12 23:23:38 +01:00
_config_dev.yaml Improved documentation 2023-02-08 00:52:45 +01:00
CNAME Create CNAME 2023-02-08 23:24:04 +01:00
concepts.md Improve documentation clarity and fix outdated information (#1129) 2025-12-06 22:40:45 +01:00
configuration.md Added documentation about the TRUSTED_HOSTS env and add it to installation guides 2026-07-19 21:40:26 +02:00
Gemfile Improved documentation 2023-02-08 00:52:45 +01:00
index.md Added documentation about AI features 2026-05-03 00:35:49 +02:00
partkeepr_migration.md Fixed more typos and grammar issues in docs 2024-02-23 14:26:17 +01:00
serve.sh Improved documentation 2023-02-08 00:52:45 +01:00
troubleshooting.md Document KiCad's rejection of self-signed certificates (#1140) 2025-12-07 19:31:16 +01:00