Commit Graph
14 Commits
Author SHA1 Message Date
davideandClaude Sonnet 5 338a7327a0 Resolve UNI family-table hardware (screws/nuts/washers) as components
These appear in the .asm binary as a family-table instance name (e.g.
"R6--_-_U6592<UNI6592>"), not a separate file on disk - only the generic
"uni6592.prt" is actually indexed. Extract just the "<UNI...>" content
instead of the full instance name, in both the standalone script and the
production scanner, so standard hardware stops being silently dropped as
"not found in index".

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-17 12:26:31 +02:00
davideandClaude Sonnet 5 52d126372d Redesign the final STEP phase to build a step_finali folder
Previously it only compared the top-level BOM against step/ and reported
matches, without copying anything. Now it unions the BOM codes with the
sub-components resolved in phase 4, copies every matching .stp into a new
step_finali/ folder, and reports what got created vs what's still missing.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-17 10:23:35 +02:00
davideandClaude Sonnet 5 ee408219bd Show a progress dialog while resolving referenced components
"Trova componenti referenziati" ran the recursive BFS synchronously on the
UI thread with no feedback. Runs it on a background task instead and shows
a modal dialog with a percentage bar, updated as each .asm in the queue is
processed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-17 09:55:14 +02:00
davideandClaude Sonnet 5 bb99c4f4c5 Apply the ModelView# false-positive fix to the production scanner
The standalone script already excluded internal saved-view IDs
(ModelView#<numero>) from the referenced-codes heuristic; the app's own
"Trova componenti referenziati" phase used the same regex without the fix.
Ports the lookbehind so both stay consistent, per docs/formato-asm.md.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-17 09:55:06 +02:00
davideandClaude Sonnet 5 4a3f0a4cf8 Cache DB verification result and reuse it when creating the raw folder
Avoids re-running the same lookup against cad_index.db twice when the
user already clicked "Verifica presenza nel DB" before "Crea cartella raw".

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-17 09:13:38 +02:00
davideandClaude Sonnet 5 b77ec39c5b Add DB presence check button to import phase
Lets the user spot missing components right after import instead of
discovering it later in the raw-folder step, by coloring each grid row
green/red based on a lookup against cad_index.db.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-17 09:08:33 +02:00
davideandClaude Sonnet 5 f28cb818bd Add standalone .asm BOM-extraction scripts and format documentation
Reverse-engineered the Creo .asm binary format enough to extract referenced
component codes via a text heuristic, mirroring AssemblyComponentScanner's
approach and Form1's recursive resolution against cad_index.db. Documents
known false-positive classes (ModelView# view IDs, self-references, and
phantom references to superseded/renamed codes).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-17 09:01:45 +02:00
davideandClaude Sonnet 5 52483177f0 Add wizard UI, general-assembly resolution, and test suite
Restructure Form1 into a sequential wizard (database -> import -> raw ->
recursive component resolution -> completeness/STEP report), fix
case-sensitivity bugs in codice/tipo_file lookups and a word-boundary gap
in the assembly scanner that missed _D100-style sub-assembly references,
and treat the distinta's general assembly as an ordinary CSV row (derived
from the DBP_<codice>_<timestamp> filename) instead of special-casing it
throughout. Also adds CadSearchGui.Tests (xUnit) covering the scanner,
filename parsing, and the case-insensitive DB lookup behavior.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-16 16:25:52 +02:00
davideandClaude Sonnet 5 146ce78eae Index Unificati/Commerciali, merge cleanup buttons, report unmatched components
- Add 'Unificati' and 'Commerciali' as indexed root folders alongside the
  existing four, updating Indexer.CartelleRadice and the docs.
- Replace the separate "Pulisci cartella raw" / "Pulisci cartella step"
  buttons with a single "Pulisci raw e step" that clears both under one
  confirmation; falls back to a folder picker when no path is known yet
  in the session instead of staying disabled.
- "Trova componenti referenziati" now also writes a persistent summary
  (PRT/sub-assemblies found and copied, codes not found) to the main
  window's status line, not just the popup dialog, and reports clearly
  when no database is loaded instead of failing silently.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-16 12:05:07 +02:00
davideandClaude Sonnet 5 e56a3be5b4 Add recursive component resolution for assembly dependencies
Assemblies reference other assemblies and parts internally; a flat
single-level copy into raw/ left Creo unable to load models ("Dati di
input non completi"). AssemblyComponentScanner heuristically extracts
component codes embedded as readable strings inside the otherwise
binary .asm files; each candidate is validated against the index (which
filters out scan noise), copied into raw/, and if it's itself an
assembly, queued for the same treatment until the whole tree resolves
to PRT leaves. PrtMancantiForm reports what was found and copied.

Also ignore Creo Distributed Batch job files (*.dxc).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-16 11:40:34 +02:00
davideandClaude Sonnet 5 97d53a16dd Add raw-folder step, redesign UI, remember last DB path, add README
- Split the import flow into explicit steps: import/preview CSV, then a
  separate "Crea cartella raw" button that looks up CAD paths and copies
  matched files into raw/ next to the source distinta file.
- Redesign the top panel with grouped, auto-sized sections (database vs.
  import) instead of hand-tuned row heights, fixing overlap/clipping bugs;
  style the primary action button and polish the results grid.
- Remember the last successfully loaded database path in
  %AppData%\CadSearchGui\ultimo_db.txt so it reloads automatically on
  future launches regardless of the working directory.
- Ignore the /step/ working folder.
- Add a README with build/run/publish instructions and project overview.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-16 10:59:16 +02:00
davideandClaude Sonnet 5 98c513dd64 Replace CAD search tab with CAD-path lookup for imported components
Drop the free-text search UI; the single remaining view imports the
Distinta Base, generates the CSV, and looks up each Componente code in
the indexed DB (files_ultima_versione, prt/asm) to show its CAD file
path directly in the results grid.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-16 10:28:15 +02:00
davideandClaude Sonnet 5 f88639bf4b Add Distinta Base import tab: parse .xls/.xml export to CSV with preview
Reads the ERP-exported "Distinta Base" file (SpreadsheetML XML or real
binary .xls/.xlsx via ExcelDataReader), extracts Componente/Descrizione,
writes a CSV and previews it in a new tab alongside the existing CAD
search. Also ignore the exported Excel/CSV files dropped in the repo root.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-16 10:22:16 +02:00
davideandClaude Sonnet 5 82a69e0d20 Add CadSearchGui: WinForms app to index and search the CAD archive
Indicizza le cartelle __Accessori, __B.end, __Corpi, __Fondi in un DB
SQLite locale ed espone una GUI di ricerca (codice, tipo, cartella,
solo ultima versione) con aggiornamento incrementale dell'indice e
stima del tempo rimanente.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-16 09:58:55 +02:00