Commit Graph

178 Commits

Author SHA1 Message Date
c5bd7fb4c8 feat: add Drawing entity with revision tracking
Introduce a Drawing table that tracks unique drawing numbers with their
current PDF content hash and revision counter. ExportRecord gains a
DrawingId FK. Includes a data migration to seed Drawings from existing
export records.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 08:54:01 -05:00
13c61a82a4 fix: log etch line failures instead of silently swallowing
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 08:53:51 -05:00
444a077cbc fix: resize form controls to match window layout
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 08:53:46 -05:00
c4920f933d chore: remove netDxf project from solution
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 08:53:39 -05:00
b472729fda feat: use perceptual hash for PDF change detection
Render PDF page 1 to an image and compute a DifferenceHash instead of
SHA256 on raw file bytes. This ignores metadata/timestamp changes that
SolidWorks varies between exports, preventing false revision bumps on
Drawing entities.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 08:52:06 -05:00
5d2948d563 feat: replace text-based DXF hash with geometric content hash
SolidWorks re-exports produce files with identical geometry but different
entity ordering, handle assignments, style names, and floating-point
epsilon values. This caused hash mismatches and unnecessary API updates.

Uses ACadSharp to parse DXF entities and build canonical, sorted
signatures (LINE, ARC, CIRCLE, MTEXT) with coordinates rounded to 4
decimal places. Falls back to raw file hash if parsing fails.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 07:40:51 -05:00
71c65e0bf5 feat: auto-populate title from part description when opening documents
Adds a Description property to DrawingInfo that extracts the
descriptive text after the equipment/drawing number, excluding the
file extension. MainForm now sets the title box from this description
when no title was already set by the API history lookup.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 05:53:08 -05:00
53aa23f762 refactor: consolidate export detail into drawing detail page
Remove the duplicate export detail page and route exports list
directly to drawing detail. When navigating from exports, the
specific export's BOM items are shown via eid param; from drawings,
items are deduplicated to the latest revision. Add Rev column,
PDF download, and All DXFs download to drawing detail.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 17:26:43 -05:00
036ab2a55a docs: add context to FixDegreeSymbol workaround
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 16:42:54 -05:00
f9e7ace35d fix: repair double-encoded degree symbol in DXF output
ACadSharp misreads UTF-8 degree symbol (C2 B0) as two ANSI_1252
characters (°) then writes that back out. Post-process the saved
DXF to replace ° with ° so bend notes display correctly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 16:31:57 -05:00
622cbf1170 fix: update EtchBendLines submodule with degree symbol fix
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 16:28:45 -05:00
4a3f33db33 fix: update EtchBendLines submodule with bend line ByLayer color
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 15:51:59 -05:00
77d0157370 fix: update EtchBendLines submodule with bend detection fixes
Fixes missing etch lines and incorrect bend layer assignment after
the ACadSharp migration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 14:34:05 -05:00
26e9233b30 fix: update EtchBendLines submodule with ACadSharp 3.4.9 upgrade
Fixes DXF files failing to open with "GroupTable dictionary was not
defined in NamedObject dictionary" error.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 14:20:57 -05:00
e59584a5c0 fix: update EtchBendLines submodule with ACAD_GROUP dictionary fix
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 14:13:12 -05:00
dcc508d479 feat: update EtchBendLines submodule with ACadSharp migration
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 12:52:48 -05:00
1266378b51 fix: update EtchBendLines submodule with etch line fix
Updates submodule to include the yield break -> return lines fix
that was causing etch lines to be silently discarded.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 12:37:29 -05:00
5de40ebafd feat: add delete button to exports list and detail pages
Add DELETE /api/exports/{id} endpoint with cascade delete, trash icon
buttons on both the exports list and export detail pages, and disable
browser caching for static files to prevent stale JS issues.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 09:34:59 -05:00
e072919a59 fix: prevent date wrapping on exports page
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 09:12:49 -05:00
7db44640ca feat: switch web UI to light theme with larger font sizes
Replace dark blueprint theme with a clean light theme for better
readability. Bump all font sizes (10px labels to 12px, 13px body
text to 14px) and improve text contrast for users with reading
glasses. Icon colors now use CSS variables instead of hardcoded hex.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 09:03:21 -05:00
0d5742124e feat: add revision tracking to CutTemplate and scope BOM items to export record
Each export record now keeps a complete BOM snapshot instead of moving
BomItems between records. CutTemplate gains a Revision field that
auto-increments when the content hash changes across exports for the
same drawing+item, and stays the same when the geometry is unchanged.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 08:47:11 -05:00
463916c75c fix: resolve drawing dropdown race condition and save PDF hash to export record
Detach EquipmentBox event before programmatically setting equipment to
prevent async UpdateDrawingDropdownAsync from clearing the drawing
selection and duplicating entries. Also update ExportRecord.PdfContentHash
in StorePdfAsync so the web frontend can serve PDF downloads.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 22:40:22 -05:00
c06d834e05 feat: add PDF download button to export detail page
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 22:20:03 -05:00
d3c154b875 chore: reset FabWorks.Core migrations from scratch
Delete old incremental migrations and regenerate a single
InitialCreate that creates all tables (ExportRecords, BomItems,
CutTemplates, FormPrograms) with current schema.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 20:37:56 -05:00
2721c33a39 fix: parse equipment number from part names without drawing number
Add equipmentOnlyRegex fallback so names like "5028 Prox switch bracket"
correctly extract equipment number 5028 even without a drawing number.
Handle null DrawingNo in ToString and UI dropdown population.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 20:37:28 -05:00
5ec66f9039 feat: add web frontend for FabWorks API
Add static HTML/CSS/JS frontend with export browser, search, and
file download capabilities served via UseStaticFiles.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 20:37:16 -05:00
cf76ca8bb1 refactor: wire ExportDXF to use FabWorks API
Replace direct DB access with API client calls throughout MainForm,
DxfExportService, PartExporter, and Program. Add title field to UI,
async export flow, API-based dropdown loading, and file uploads.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 20:37:05 -05:00
696bf2f72c feat: add BomItem upsert and find endpoints
Add find-existing endpoint and upsert logic to POST so re-exporting
a part updates the existing BomItem rather than creating duplicates.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 20:36:52 -05:00
8de441e126 feat: expand ExportsController with search and file endpoints
Add list/search, equipment/drawing number lookups, PDF hash tracking,
cut template lookup, DXF zip download, and wire up FileStorageService
and static files in Program.cs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 20:36:42 -05:00
8b6950ef28 feat: add Title, EquipmentNo, DrawingNo to ExportRecord
Add separate EquipmentNo and DrawingNo fields alongside the combined
DrawingNumber, plus a Title field for labeling exports. Updated across
Core model, DbContext, API DTOs, and ExportDXF models.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 20:36:30 -05:00
dba68ecc71 feat: add file storage service with content-addressed blob store
Add FileStorageService for DXF/PDF storage using content hashing,
FileStorageOptions config, FilesController for uploads, and
FileBrowserController for browsing stored files.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 20:36:18 -05:00
f75b83d483 feat: add FabWorks API client for ExportDXF
Add IFabWorksApiClient interface, FabWorksApiClient implementation,
and DTO classes for communicating with the FabWorks API from the
SolidWorks add-in.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 20:36:06 -05:00
2273a83e42 refactor: remove local DB and file export from ExportDXF
Remove ExportDxfDbContext, EF migrations, FileExportService, and
SqlServer/EF Tools packages. ExportDXF will now use the FabWorks API
for persistence and file storage instead of direct DB access.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 20:35:55 -05:00
e10a7ed0ed feat: add EF migration for FormPrograms table
Add initial FabWorksDbContext migration that creates the FormPrograms
table with FK to BomItems. Existing tables (ExportRecords, BomItems,
CutTemplates) are excluded from the migration since they were already
created by ExportDXF's ExportDxfDbContext. Also adds EF Core Design
package to FabWorks.Api for migration tooling support.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 06:37:03 -05:00
16dc74c35d test: add FormProgramService tests
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 06:36:02 -05:00
9e5e44c1ed feat: add BomItems and FormPrograms controllers with parse service
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 06:32:52 -05:00
ab76fa61c9 feat: add FabWorks.Api with ExportsController and DTOs
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 06:32:41 -05:00
28c9f715be test: add ProgramReader tests validating CincyLib port
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 06:27:12 -05:00
2bef75f548 feat: port CincyLib PressBrake parser to FabWorks.Core (net8.0)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 06:22:46 -05:00
78a8a2197d feat: add FabWorks.Core shared library with entity models and FormProgram
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 06:20:13 -05:00
719dca1ca5 feat: add export history auto-fill, fix filename prefixes, persist records for all doc types
- Add database-first lookup for equipment/drawing number auto-fill when
  reopening previously exported files
- Remove prefix prepending for named parts (only use prefix for PT## BOM items)
- Create ExportRecord/BomItem/CutTemplate chains for Part and Assembly
  exports, not just Drawings
- Add auto-incrementing item numbers across drawing numbers
- Add content hashing (SHA256) for DXF and PDF versioning with
  stash/archive pattern
- Add EF Core initial migration for ExportDxfDb

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 13:09:02 -05:00
a17d8cac49 refactor: consolidate output folder resolution and prefix handling
Move ParseDrawingNumber + GetDrawingOutputFolder into Export() before
the document-type switch so folder resolution happens once. Extract
PrependPrefix helper in PartExporter to deduplicate the prefix guard.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 08:45:53 -05:00
32e8379e9b refactor: extract CutTemplate from BomItem for all-item BOM tracking
BomItems are now created for every BOM item regardless of whether they
produce a DXF. Sheet metal cut data (thickness, k-factor, bend radius,
DXF path, content hash) moved to a new CutTemplate entity with a 1:1
optional relationship. Non-sheet-metal items are counted as "skipped"
instead of "failed" in the export summary. Added Cut Templates tab to
the UI with a DataGridView for viewing cut template records.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 15:32:17 -05:00
0ace378eff docs: update README to reflect local export and .NET 8 migration
Remove CutFab API references and document the current architecture:
local file export, SQL Server tracking, and .NET 8.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 22:35:41 -05:00
697463f61e feat: disable SolidWorks user input during export
Sets CommandInProgress to block user interaction with SolidWorks
while the DXF export is running, preventing accidental interference.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 22:32:12 -05:00
aj
4eb13a1aca Added Readme 2026-02-13 22:18:36 -05:00
49051b5e64 refactor: replace CutFab API with local file export and database
Remove CutFabApiClient and DrawingSelectionForm - exports no longer
depend on an external API server. DXF/PDF files are saved directly
to a configurable output folder, and export records are persisted
to a local SQL Server database via EF Core.

Replace Color-based progress logging with LogLevel enum across all
services. Redesign MainForm with equipment/drawing filter dropdowns
populated from export history, log row coloring by severity, and
simplified startup flow in Program.cs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 11:27:04 -05:00
384fceb047 feat: add local database and file export infrastructure
Add EF Core DbContext with ExportRecord and BomItem entities for
tracking export history locally. Add FileExportService for saving
DXF and PDF files to a configurable output folder.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 11:26:50 -05:00
c4926c6e9f refactor: migrate to .NET 8 SDK-style project format
Convert from .NET Framework 4.8 legacy csproj to .NET 8 SDK-style.
Add ComHelper class for COM Running Object Table access, replacing
Marshal.GetActiveObject which is not available in .NET Core.
Add EF Core and System.Configuration.ConfigurationManager packages.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 11:26:40 -05:00
6b1a5f0ab6 docs: remove AGENTS.md documentation file
Remove obsolete or unnecessary documentation file.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-04 09:59:16 -05:00