refactor(PepLib.Core): reorganize files into logical folder structure

Move 38 files from root directory into organized subfolders:
- Enums/ (7 files): StatusType, ApplicationType, DrawingType, etc.
- Geometry/ (5 files): Vector, Box, Size, Spacing, Node
- Models/ (15 files): Nest, Plate, Part, Program, Report, etc.
- Utilities/ (7 files): MathHelper, Tolerance, ZipHelper, etc.
- Extensions/ (2 files): PartListExtensions, PlateListExtensions
- Interfaces/ (1 file): IMovable

Update namespaces to follow folder hierarchy (e.g., PepLib.Models).
Add GlobalUsings.cs for internal backward compatibility.
Update Codes/ and IO/ files with new using statements.
Update PepApi.Core consumers to reference new namespaces.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-23 09:29:13 -05:00
parent c5be48a807
commit 9088af52de
55 changed files with 137 additions and 76 deletions

View File

@@ -3,8 +3,8 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using PepApi.Core.Configuration; using PepApi.Core.Configuration;
using PepApi.Core.Models; using PepApi.Core.Models;
using PepLib;
using PepLib.Data; using PepLib.Data;
using PepLib.Models;
using Plate = PepApi.Core.Models.Plate; using Plate = PepApi.Core.Models.Plate;
namespace PepApi.Core.Controllers; namespace PepApi.Core.Controllers;

View File

@@ -1,5 +1,5 @@
using PepApi.Core.Models; using PepApi.Core.Models;
using PepLib; using PepLib.Models;
namespace PepApi.Core namespace PepApi.Core
{ {

View File

@@ -1,4 +1,4 @@
using PepLib; using PepLib.Models;
using Material = PepApi.Core.Models.Material; using Material = PepApi.Core.Models.Material;
using Part = PepApi.Core.Models.Part; using Part = PepApi.Core.Models.Part;
using Plate = PepApi.Core.Models.Plate; using Plate = PepApi.Core.Models.Plate;
@@ -8,7 +8,7 @@ namespace PepApi.Core
{ {
internal static class PepHelper internal static class PepHelper
{ {
public static bool IsTestSquare(PepLib.Part part) public static bool IsTestSquare(PepLib.Models.Part part)
{ {
if (part == null || part.DrawingName == null) if (part == null || part.DrawingName == null)
return false; return false;
@@ -39,7 +39,7 @@ namespace PepApi.Core
return count; return count;
} }
public static bool AreTestSquaresInCorrectOrder(PepLib.Plate plate) public static bool AreTestSquaresInCorrectOrder(PepLib.Models.Plate plate)
{ {
var partsStarted = false; var partsStarted = false;
@@ -68,7 +68,7 @@ namespace PepApi.Core
return true; return true;
} }
public static bool AreTestSquaresInCorrectOrder(PepLib.Nest nest) public static bool AreTestSquaresInCorrectOrder(PepLib.Models.Nest nest)
{ {
foreach (var plate in nest.Plates) foreach (var plate in nest.Plates)
{ {
@@ -229,7 +229,7 @@ namespace PepApi.Core
.ToList(); .ToList();
} }
public static Material GetMaterial(PepLib.Plate plate) public static Material GetMaterial(PepLib.Models.Plate plate)
{ {
return new Material return new Material
{ {
@@ -240,7 +240,7 @@ namespace PepApi.Core
}; };
} }
public static Material GetMaterial(PepLib.Nest nest) public static Material GetMaterial(PepLib.Models.Nest nest)
{ {
return GetMaterial(nest.Plates.First()); return GetMaterial(nest.Plates.First());
} }

View File

@@ -1,4 +1,6 @@
using PepLib.Enums;
using PepLib.Geometry;
namespace PepLib.Codes namespace PepLib.Codes
{ {
public class CircularMove : Motion public class CircularMove : Motion

View File

@@ -1,4 +1,5 @@
using PepLib.Geometry;
namespace PepLib.Codes namespace PepLib.Codes
{ {
public class LinearMove : Motion public class LinearMove : Motion

View File

@@ -1,4 +1,6 @@
using PepLib.Geometry;
using PepLib.Interfaces;
namespace PepLib.Codes namespace PepLib.Codes
{ {
public abstract class Motion : IMovable, ICode public abstract class Motion : IMovable, ICode

View File

@@ -1,4 +1,6 @@
namespace PepLib.Codes using PepLib.Geometry;
namespace PepLib.Codes
{ {
public class RapidMove : Motion public class RapidMove : Motion
{ {

View File

@@ -1,4 +1,5 @@
using PepLib.Enums;
namespace PepLib.Codes namespace PepLib.Codes
{ {
public class SetKerf : ICode public class SetKerf : ICode

View File

@@ -1,4 +1,6 @@
using PepLib.Models;
using PepLib.Utilities;
namespace PepLib.Codes namespace PepLib.Codes
{ {
public class SubProgramCall : ICode public class SubProgramCall : ICode

View File

@@ -1,5 +1,5 @@

namespace PepLib namespace PepLib.Enums
{ {
public enum ApplicationType public enum ApplicationType
{ {

View File

@@ -1,5 +1,5 @@

namespace PepLib namespace PepLib.Enums
{ {
public enum DrawingType public enum DrawingType
{ {

View File

@@ -1,5 +1,5 @@

namespace PepLib namespace PepLib.Enums
{ {
public enum GrainType public enum GrainType
{ {

View File

@@ -1,5 +1,5 @@

namespace PepLib namespace PepLib.Enums
{ {
public enum KerfType public enum KerfType
{ {

View File

@@ -1,4 +1,4 @@
namespace PepLib namespace PepLib.Enums
{ {
public enum ProgrammingMode public enum ProgrammingMode
{ {

View File

@@ -1,5 +1,5 @@

namespace PepLib namespace PepLib.Enums
{ {
public enum RotationType public enum RotationType
{ {

View File

@@ -1,5 +1,5 @@

namespace PepLib namespace PepLib.Enums
{ {
public enum StatusType public enum StatusType
{ {

View File

@@ -1,4 +1,7 @@
namespace PepLib using PepLib.Geometry;
using PepLib.Models;
namespace PepLib.Extensions
{ {
public static class PartListExtensions public static class PartListExtensions
{ {

View File

@@ -1,4 +1,6 @@
namespace PepLib using PepLib.Models;
namespace PepLib.Extensions
{ {
public static class PlateListExtensions public static class PlateListExtensions
{ {

View File

@@ -1,4 +1,4 @@
namespace PepLib namespace PepLib.Geometry
{ {
public class Box public class Box
{ {
@@ -10,7 +10,7 @@
public Box(double x, double y, double w, double h) public Box(double x, double y, double w, double h)
{ {
Location = new Vector(x, y); Location = new Vector(x, y);
Size = new PepLib.Size(0, 0); Size = new Size(0, 0);
Width = w; Width = w;
Height = h; Height = h;
} }

View File

@@ -1,4 +1,4 @@
namespace PepLib namespace PepLib.Geometry
{ {
public class Node public class Node
{ {

View File

@@ -1,4 +1,4 @@
namespace PepLib namespace PepLib.Geometry
{ {
public class Size public class Size
{ {
@@ -42,4 +42,4 @@
return string.Format("{0} x {1}", Height, Width); return string.Format("{0} x {1}", Height, Width);
} }
} }
} }

View File

@@ -1,5 +1,5 @@

namespace PepLib namespace PepLib.Geometry
{ {
public class Spacing public class Spacing
{ {

View File

@@ -1,4 +1,6 @@
namespace PepLib using PepLib.Utilities;
namespace PepLib.Geometry
{ {
public struct Vector public struct Vector
{ {

View File

@@ -0,0 +1,6 @@
global using PepLib.Enums;
global using PepLib.Geometry;
global using PepLib.Models;
global using PepLib.Utilities;
global using PepLib.Extensions;
global using PepLib.Interfaces;

View File

@@ -1,4 +1,7 @@
using System.Text; using PepLib.Enums;
using PepLib.Models;
using PepLib.Utilities;
using System.Text;
namespace PepLib.IO namespace PepLib.IO
{ {

View File

@@ -1,3 +1,4 @@
using PepLib.Models;
using System.Diagnostics; using System.Diagnostics;
using System.IO.Compression; using System.IO.Compression;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;

View File

@@ -1,4 +1,6 @@
using PepLib.Codes; using PepLib.Codes;
using PepLib.Geometry;
using PepLib.Models;
namespace PepLib.IO namespace PepLib.IO
{ {

View File

@@ -1,4 +1,7 @@
using System.Text; using PepLib.Enums;
using PepLib.Models;
using PepLib.Utilities;
using System.Text;
namespace PepLib.IO namespace PepLib.IO
{ {

View File

@@ -1,3 +1,4 @@
using PepLib.Models;
using System.Diagnostics; using System.Diagnostics;
using System.IO.Compression; using System.IO.Compression;
using System.Text; using System.Text;

View File

@@ -1,4 +1,7 @@
using PepLib.Codes; using PepLib.Codes;
using PepLib.Geometry;
using PepLib.Models;
using PepLib.Utilities;
namespace PepLib.IO namespace PepLib.IO
{ {

View File

@@ -1,4 +1,7 @@
using PepLib.Codes; using PepLib.Codes;
using PepLib.Enums;
using PepLib.Geometry;
using PepLib.Models;
using System.Text; using System.Text;
namespace PepLib.IO namespace PepLib.IO

View File

@@ -1,4 +1,6 @@
using System.Diagnostics; using PepLib.Models;
using PepLib.Utilities;
using System.Diagnostics;
namespace PepLib.IO namespace PepLib.IO
{ {

View File

@@ -1,4 +1,6 @@
namespace PepLib using PepLib.Geometry;
namespace PepLib.Interfaces
{ {
public interface IMovable public interface IMovable
{ {

View File

@@ -1,7 +1,8 @@
using PepLib.Codes; using PepLib.Codes;
using PepLib.Enums;
using PepLib.IO; using PepLib.IO;
namespace PepLib namespace PepLib.Models
{ {
public class Drawing public class Drawing
{ {

View File

@@ -1,6 +1,7 @@
using PepLib.Enums;
using PepLib.IO; using PepLib.IO;
namespace PepLib namespace PepLib.Models
{ {
public class DrawingInfo public class DrawingInfo
{ {
@@ -103,4 +104,3 @@ namespace PepLib
} }
} }
} }

View File

@@ -1,6 +1,8 @@
using PepLib.Codes; using PepLib.Codes;
using PepLib.Enums;
using PepLib.Geometry;
namespace PepLib namespace PepLib.Models
{ {
public class Loop : Program public class Loop : Program
{ {

View File

@@ -1,4 +1,4 @@
namespace PepLib namespace PepLib.Models
{ {
public class Machine public class Machine
{ {

View File

@@ -1,4 +1,4 @@
namespace PepLib namespace PepLib.Models
{ {
public class Material public class Material
{ {

View File

@@ -1,7 +1,7 @@
using PepLib.Codes; using PepLib.Codes;
using PepLib.IO; using PepLib.IO;
namespace PepLib namespace PepLib.Models
{ {
public class Nest public class Nest
{ {

View File

@@ -1,4 +1,4 @@
namespace PepLib namespace PepLib.Models
{ {
public class NestDrawing public class NestDrawing
{ {

View File

@@ -1,7 +1,7 @@
using PepLib.IO; using PepLib.IO;
using System.Text; using System.Text;
namespace PepLib namespace PepLib.Models
{ {
public class NestIndex public class NestIndex
{ {

View File

@@ -1,6 +1,7 @@
using PepLib.IO; using PepLib.Enums;
using PepLib.IO;
namespace PepLib namespace PepLib.Models
{ {
public class NestInfo public class NestInfo
{ {
@@ -94,4 +95,4 @@ namespace PepLib
return true; return true;
} }
} }
} }

View File

@@ -1,4 +1,8 @@
namespace PepLib using PepLib.Enums;
using PepLib.Geometry;
using PepLib.Interfaces;
namespace PepLib.Models
{ {
public class Part : IMovable public class Part : IMovable
{ {

View File

@@ -1,4 +1,9 @@
namespace PepLib using PepLib.Extensions;
using PepLib.Geometry;
using PepLib.Interfaces;
using PepLib.Utilities;
namespace PepLib.Models
{ {
public class Plate : IMovable public class Plate : IMovable
{ {

View File

@@ -1,7 +1,11 @@
using PepLib.Codes; using PepLib.Codes;
using PepLib.Enums;
using PepLib.Geometry;
using PepLib.Interfaces;
using PepLib.IO; using PepLib.IO;
using PepLib.Utilities;
namespace PepLib namespace PepLib.Models
{ {
public class Program : List<ICode>, IMovable public class Program : List<ICode>, IMovable
{ {

View File

@@ -1,4 +1,4 @@
namespace PepLib namespace PepLib.Models
{ {
public partial class Report public partial class Report
{ {

View File

@@ -1,5 +1,5 @@

namespace PepLib namespace PepLib.Models
{ {
public partial class Report public partial class Report
{ {

View File

@@ -1,6 +1,6 @@
using PepLib.IO; using PepLib.IO;
namespace PepLib namespace PepLib.Models
{ {
public partial class Report public partial class Report
{ {
@@ -118,4 +118,4 @@ namespace PepLib
return true; return true;
} }
} }
} }

View File

@@ -1,4 +1,4 @@
namespace PepLib namespace PepLib.Utilities
{ {
public static class AngleConverter public static class AngleConverter
{ {

View File

@@ -1,4 +1,4 @@
namespace PepLib namespace PepLib.Utilities
{ {
public static class Generic public static class Generic
{ {

View File

@@ -1,4 +1,6 @@
namespace PepLib using PepLib.Geometry;
namespace PepLib.Utilities
{ {
public class IniConfig public class IniConfig
{ {

View File

@@ -1,4 +1,4 @@
namespace PepLib namespace PepLib.Utilities
{ {
public static class MathHelper public static class MathHelper
{ {

View File

@@ -1,4 +1,4 @@
namespace PepLib namespace PepLib.Utilities
{ {
public static class Tolerance public static class Tolerance
{ {

View File

@@ -1,6 +1,6 @@
using System.Diagnostics; using System.Diagnostics;
namespace PepLib namespace PepLib.Utilities
{ {
public static class Util public static class Util
{ {

View File

@@ -1,7 +1,7 @@
using System.IO.Compression; using System.IO.Compression;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
namespace PepLib namespace PepLib.Utilities
{ {
public static class ZipHelper public static class ZipHelper
{ {
@@ -79,4 +79,3 @@ namespace PepLib
} }
} }
} }