Part-DB-server/tests
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 Correctly parse @id referenced entities in API 2026-05-25 22:37:48 +02:00
assets Added custom part status (#1053) 2025-10-27 21:58:16 +01:00
Command Enhance KiCad integration: API v2, batch EDA editing, field export control (#1241) 2026-03-01 22:10:13 +01:00
Controller Add a component value calculator & image generator 2026-07-30 17:49:18 +02:00
DataTables/Filters Ran rector and made tests final 2026-02-14 23:32:43 +01:00
Doctrine Moved from phpunit annotation to attribute 2026-06-25 12:12:34 +02:00
Entity Removed useless setAccessible() calls 2026-06-25 10:54:13 +02:00
EnvVarProcessors Ran rector and made tests final 2026-02-14 23:32:43 +01:00
EventListener Ran rector and made tests final 2026-02-14 23:32:43 +01:00
EventSubscriber Added more tests 2026-05-11 21:50:33 +02:00
Exceptions Ran rector and made tests final 2026-02-14 23:32:43 +01:00
Form/InfoProviderSystem Ran rector and made tests final 2026-02-14 23:32:43 +01:00
Helpers Warn if ProjectBuild passed lot if null 2026-06-25 12:07:54 +02:00
Repository Ran rector and made tests final 2026-02-14 23:32:43 +01:00
Security Ran rector and made tests final 2026-02-14 23:32:43 +01:00
Serializer Correctly denormalize parent-child relationships in import, when only children not parent fields are given 2026-03-07 21:08:32 +01:00
Services Add a component value calculator & image generator 2026-07-30 17:49:18 +02:00
Settings Refactored size checks for attachments and check base64 upload length 2026-07-09 19:33:11 +02:00
Twig Moved remaining twig extensions to new attributes system 2026-02-15 00:23:30 +01:00
Validator Test some more edge cases in tests 2026-05-11 23:13:46 +02:00
.gitignore Initial commit 2019-02-23 16:49:38 +01:00
ApplicationAvailabilityFunctionalTest.php Add custom KiCad autocomplete list settings (#1342) 2026-04-15 00:01:00 +02:00
bootstrap.php Updated phpunit recipe 2025-07-13 16:53:41 +02:00
DatatablesAvailabilityTest.php Ran rector and made tests final 2026-02-14 23:32:43 +01:00
object-manager.php Fixed PHPstan issues 2023-08-28 22:39:29 +02:00
SettingsTestHelper.php Run rector 2025-07-14 00:26:40 +02:00
symfony-container.php Added declare strict types to all files 2023-06-11 18:59:07 +02:00