Commit Graph

28 Commits

Author SHA1 Message Date
AJ
d1a5dd279c Add validation and business logic to domain models
Enhance Tool, BinItem, and MultiBin classes with:
- Input validation in constructors and property setters
- Guard clauses for invalid states (negative values, empty names)
- Business logic methods (CanFitItem, CalculateWaste, etc.)
- Proper encapsulation with backing fields
- Comprehensive XML documentation
- Override Equals/GetHashCode for value semantics
- Better ToString() implementations

These changes enforce business rules at the domain level and prevent
invalid states from being created.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 23:02:37 -05:00
AJ
f55092d877 Refactor Helper to FormatHelper with improved documentation
- Rename Helper class to FormatHelper for clarity
- Add comprehensive XML documentation
- Update all references in BinFileSaver, ArchUnits, and Bin
- Remove unused System.Drawing import
- Better method documentation explaining parameters and return values

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 23:02:24 -05:00
AJ
70f1380847 Migrate projects from .NET Framework 4.7.2 to .NET 8
- Convert CutList.csproj to SDK-style project format
- Convert SawCut.csproj to SDK-style project format
- Remove obsolete packages.config files (now using PackageReference)
- Remove App.config (not needed in .NET 8)
- Update package references to use SDK-style format
- Enable nullable reference types and implicit usings
- Preserve publishing configuration for network deployment

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 23:02:12 -05:00
AJ
ee5c20bc8b Add factory pattern for engine creation
Replace hard-coded engine instantiation with factory pattern
to enable dependency injection and improve testability.

Changes:
- IEngineFactory: Interface for creating engines
- EngineFactory: Default implementation using AdvancedFitEngine
- MultiBinEngine: Now accepts IEngineFactory via constructor

This eliminates the hard-coded dependency on AdvancedFitEngine
and allows for easy swapping of engine implementations through
configuration or dependency injection.

Benefits:
- Dependency inversion principle satisfied
- Engines can be mocked in tests
- Engine selection can be configured externally
- Single responsibility for engine creation

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-18 17:43:22 -05:00
AJ
703efd528a Encapsulate mutable collections in Bin and Result
Replace public mutable collection fields/properties with private
backing fields and expose them as IReadOnlyList. Add proper methods
for mutation (AddItem, AddItems, RemoveItem, SortItems).

Changes:
- Bin.Items: Now private with AddItem/AddItems/RemoveItem/SortItems
- Result.ItemsNotUsed: Now readonly with Add methods
- Result.Bins: Now readonly with Add methods
- Updated all engine classes to use new encapsulated APIs

This improves encapsulation and prevents external code from
bypassing business logic by directly manipulating collections.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-18 16:02:48 -05:00
AJ
2869daf4f7 Remove commented-out sanity check code in MultiBinEngine 2025-10-01 23:26:30 -04:00
AJ
b8612f72d7 Fix null reference risk in BestFitEngine 2025-10-01 23:25:43 -04:00
AJ
d64d5a8d53 Fix CreateDuplicateBins bug in AdvancedFitEngine 2025-10-01 23:23:12 -04:00
AJ
a4dfd8c0c4 Simplified BestCombination.FindFrom2 2025-10-01 23:17:34 -04:00
AJ
0fb54daf6f Duplicate bins when possible in AdvancedFitEngine 2025-01-11 00:02:01 -05:00
AJ
ccbf8beeae Allow quantity -1 for infinite. 2025-01-05 23:16:39 -05:00
AJ
a1ad16bc52 Document 2025-01-02 23:21:34 -05:00
AJ
08b3aa9182 Didnt like the name EnhancedBestFitEngine, new one isn't great either but it's better 2025-01-01 00:48:33 -05:00
AJ
8651465864 Refactored BestCombination.FindFrom2 2024-12-29 22:17:05 -05:00
AJ Isaacs
791eb23fc0 Show mixed fractions instead of decimals for output 2024-12-09 10:26:36 -05:00
AJ Isaacs
0b20ac5acf Fixed wrong name 2024-12-09 10:18:10 -05:00
AJ Isaacs
6c719f6ca5 Sort items from largest to smallest after packing 2024-12-09 10:17:06 -05:00
AJ Isaacs
1b2d7a004c Show inches as mixed fraction in ArchUnits 2024-12-09 10:16:07 -05:00
AJ
d3ab49a7d2 Renamed Engine2 to EnhancedBestFitEngine 2023-03-01 21:59:24 -05:00
AJ
2ce685bb83 Added Toolbox to manage tools 2023-01-14 08:39:01 -05:00
AJ
93f5571bbb BestCombination 2022-12-11 21:42:16 -05:00
AJ
b65dd1ec7d Used lower value priority bins first. 2022-02-09 11:22:56 -05:00
AJ
90d770e10c Fixed utilization greater than 100 percent 2021-11-15 09:10:20 -05:00
AJ
263ce9c0f4 Round inches when converting to feet / inches 2021-10-14 08:03:21 -04:00
AJ
fc557d2500 Cleanup 2021-10-07 09:12:38 -04:00
AJ
63fa51c5cd Display lengths in feet and inches 2021-10-05 09:25:39 -04:00
AJ
28d53e6d38 Multi-bin nesting 2021-10-05 09:24:05 -04:00
AJ
44f3cbfa81 Moved nesting to SawCut library 2021-10-04 19:06:33 -04:00