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:
@@ -3,8 +3,8 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Options;
|
||||
using PepApi.Core.Configuration;
|
||||
using PepApi.Core.Models;
|
||||
using PepLib;
|
||||
using PepLib.Data;
|
||||
using PepLib.Models;
|
||||
using Plate = PepApi.Core.Models.Plate;
|
||||
|
||||
namespace PepApi.Core.Controllers;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using PepApi.Core.Models;
|
||||
using PepLib;
|
||||
using PepLib.Models;
|
||||
|
||||
namespace PepApi.Core
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using PepLib;
|
||||
using PepLib.Models;
|
||||
using Material = PepApi.Core.Models.Material;
|
||||
using Part = PepApi.Core.Models.Part;
|
||||
using Plate = PepApi.Core.Models.Plate;
|
||||
@@ -8,7 +8,7 @@ namespace PepApi.Core
|
||||
{
|
||||
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)
|
||||
return false;
|
||||
@@ -39,7 +39,7 @@ namespace PepApi.Core
|
||||
return count;
|
||||
}
|
||||
|
||||
public static bool AreTestSquaresInCorrectOrder(PepLib.Plate plate)
|
||||
public static bool AreTestSquaresInCorrectOrder(PepLib.Models.Plate plate)
|
||||
{
|
||||
var partsStarted = false;
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace PepApi.Core
|
||||
return true;
|
||||
}
|
||||
|
||||
public static bool AreTestSquaresInCorrectOrder(PepLib.Nest nest)
|
||||
public static bool AreTestSquaresInCorrectOrder(PepLib.Models.Nest nest)
|
||||
{
|
||||
foreach (var plate in nest.Plates)
|
||||
{
|
||||
@@ -229,7 +229,7 @@ namespace PepApi.Core
|
||||
.ToList();
|
||||
}
|
||||
|
||||
public static Material GetMaterial(PepLib.Plate plate)
|
||||
public static Material GetMaterial(PepLib.Models.Plate plate)
|
||||
{
|
||||
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());
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
|
||||
using PepLib.Enums;
|
||||
using PepLib.Geometry;
|
||||
|
||||
namespace PepLib.Codes
|
||||
{
|
||||
public class CircularMove : Motion
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
|
||||
using PepLib.Geometry;
|
||||
|
||||
namespace PepLib.Codes
|
||||
{
|
||||
public class LinearMove : Motion
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
|
||||
using PepLib.Geometry;
|
||||
using PepLib.Interfaces;
|
||||
|
||||
namespace PepLib.Codes
|
||||
{
|
||||
public abstract class Motion : IMovable, ICode
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
namespace PepLib.Codes
|
||||
using PepLib.Geometry;
|
||||
|
||||
namespace PepLib.Codes
|
||||
{
|
||||
public class RapidMove : Motion
|
||||
{
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
|
||||
using PepLib.Enums;
|
||||
|
||||
namespace PepLib.Codes
|
||||
{
|
||||
public class SetKerf : ICode
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
|
||||
using PepLib.Models;
|
||||
using PepLib.Utilities;
|
||||
|
||||
namespace PepLib.Codes
|
||||
{
|
||||
public class SubProgramCall : ICode
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
namespace PepLib
|
||||
|
||||
namespace PepLib.Enums
|
||||
{
|
||||
public enum ApplicationType
|
||||
{
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
namespace PepLib
|
||||
|
||||
namespace PepLib.Enums
|
||||
{
|
||||
public enum DrawingType
|
||||
{
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
namespace PepLib
|
||||
|
||||
namespace PepLib.Enums
|
||||
{
|
||||
public enum GrainType
|
||||
{
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
namespace PepLib
|
||||
|
||||
namespace PepLib.Enums
|
||||
{
|
||||
public enum KerfType
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace PepLib
|
||||
namespace PepLib.Enums
|
||||
{
|
||||
public enum ProgrammingMode
|
||||
{
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
namespace PepLib
|
||||
|
||||
namespace PepLib.Enums
|
||||
{
|
||||
public enum RotationType
|
||||
{
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
namespace PepLib
|
||||
|
||||
namespace PepLib.Enums
|
||||
{
|
||||
public enum StatusType
|
||||
{
|
||||
@@ -1,4 +1,7 @@
|
||||
namespace PepLib
|
||||
using PepLib.Geometry;
|
||||
using PepLib.Models;
|
||||
|
||||
namespace PepLib.Extensions
|
||||
{
|
||||
public static class PartListExtensions
|
||||
{
|
||||
@@ -1,4 +1,6 @@
|
||||
namespace PepLib
|
||||
using PepLib.Models;
|
||||
|
||||
namespace PepLib.Extensions
|
||||
{
|
||||
public static class PlateListExtensions
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace PepLib
|
||||
namespace PepLib.Geometry
|
||||
{
|
||||
public class Box
|
||||
{
|
||||
@@ -10,7 +10,7 @@
|
||||
public Box(double x, double y, double w, double h)
|
||||
{
|
||||
Location = new Vector(x, y);
|
||||
Size = new PepLib.Size(0, 0);
|
||||
Size = new Size(0, 0);
|
||||
Width = w;
|
||||
Height = h;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace PepLib
|
||||
namespace PepLib.Geometry
|
||||
{
|
||||
public class Node
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace PepLib
|
||||
namespace PepLib.Geometry
|
||||
{
|
||||
public class Size
|
||||
{
|
||||
@@ -42,4 +42,4 @@
|
||||
return string.Format("{0} x {1}", Height, Width);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
namespace PepLib
|
||||
|
||||
namespace PepLib.Geometry
|
||||
{
|
||||
public class Spacing
|
||||
{
|
||||
@@ -1,4 +1,6 @@
|
||||
namespace PepLib
|
||||
using PepLib.Utilities;
|
||||
|
||||
namespace PepLib.Geometry
|
||||
{
|
||||
public struct Vector
|
||||
{
|
||||
6
PepLib.Core/GlobalUsings.cs
Normal file
6
PepLib.Core/GlobalUsings.cs
Normal 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;
|
||||
@@ -1,4 +1,7 @@
|
||||
using System.Text;
|
||||
using PepLib.Enums;
|
||||
using PepLib.Models;
|
||||
using PepLib.Utilities;
|
||||
using System.Text;
|
||||
|
||||
namespace PepLib.IO
|
||||
{
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using PepLib.Models;
|
||||
using System.Diagnostics;
|
||||
using System.IO.Compression;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using PepLib.Codes;
|
||||
using PepLib.Geometry;
|
||||
using PepLib.Models;
|
||||
|
||||
namespace PepLib.IO
|
||||
{
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
using System.Text;
|
||||
using PepLib.Enums;
|
||||
using PepLib.Models;
|
||||
using PepLib.Utilities;
|
||||
using System.Text;
|
||||
|
||||
namespace PepLib.IO
|
||||
{
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using PepLib.Models;
|
||||
using System.Diagnostics;
|
||||
using System.IO.Compression;
|
||||
using System.Text;
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
using PepLib.Codes;
|
||||
using PepLib.Geometry;
|
||||
using PepLib.Models;
|
||||
using PepLib.Utilities;
|
||||
|
||||
namespace PepLib.IO
|
||||
{
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
using PepLib.Codes;
|
||||
using PepLib.Enums;
|
||||
using PepLib.Geometry;
|
||||
using PepLib.Models;
|
||||
using System.Text;
|
||||
|
||||
namespace PepLib.IO
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using System.Diagnostics;
|
||||
using PepLib.Models;
|
||||
using PepLib.Utilities;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace PepLib.IO
|
||||
{
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
namespace PepLib
|
||||
using PepLib.Geometry;
|
||||
|
||||
namespace PepLib.Interfaces
|
||||
{
|
||||
public interface IMovable
|
||||
{
|
||||
@@ -1,7 +1,8 @@
|
||||
using PepLib.Codes;
|
||||
using PepLib.Codes;
|
||||
using PepLib.Enums;
|
||||
using PepLib.IO;
|
||||
|
||||
namespace PepLib
|
||||
namespace PepLib.Models
|
||||
{
|
||||
public class Drawing
|
||||
{
|
||||
@@ -1,6 +1,7 @@
|
||||
using PepLib.Enums;
|
||||
using PepLib.IO;
|
||||
|
||||
namespace PepLib
|
||||
namespace PepLib.Models
|
||||
{
|
||||
public class DrawingInfo
|
||||
{
|
||||
@@ -103,4 +104,3 @@ namespace PepLib
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace PepLib
|
||||
namespace PepLib.Models
|
||||
{
|
||||
public class Machine
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace PepLib
|
||||
namespace PepLib.Models
|
||||
{
|
||||
public class Material
|
||||
{
|
||||
@@ -1,7 +1,7 @@
|
||||
using PepLib.Codes;
|
||||
using PepLib.Codes;
|
||||
using PepLib.IO;
|
||||
|
||||
namespace PepLib
|
||||
namespace PepLib.Models
|
||||
{
|
||||
public class Nest
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace PepLib
|
||||
namespace PepLib.Models
|
||||
{
|
||||
public class NestDrawing
|
||||
{
|
||||
@@ -1,7 +1,7 @@
|
||||
using PepLib.IO;
|
||||
using PepLib.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace PepLib
|
||||
namespace PepLib.Models
|
||||
{
|
||||
public class NestIndex
|
||||
{
|
||||
@@ -1,6 +1,7 @@
|
||||
using PepLib.IO;
|
||||
using PepLib.Enums;
|
||||
using PepLib.IO;
|
||||
|
||||
namespace PepLib
|
||||
namespace PepLib.Models
|
||||
{
|
||||
public class NestInfo
|
||||
{
|
||||
@@ -94,4 +95,4 @@ namespace PepLib
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,8 @@
|
||||
namespace PepLib
|
||||
using PepLib.Enums;
|
||||
using PepLib.Geometry;
|
||||
using PepLib.Interfaces;
|
||||
|
||||
namespace PepLib.Models
|
||||
{
|
||||
public class Part : IMovable
|
||||
{
|
||||
@@ -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
|
||||
{
|
||||
@@ -1,7 +1,11 @@
|
||||
using PepLib.Codes;
|
||||
using PepLib.Codes;
|
||||
using PepLib.Enums;
|
||||
using PepLib.Geometry;
|
||||
using PepLib.Interfaces;
|
||||
using PepLib.IO;
|
||||
using PepLib.Utilities;
|
||||
|
||||
namespace PepLib
|
||||
namespace PepLib.Models
|
||||
{
|
||||
public class Program : List<ICode>, IMovable
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace PepLib
|
||||
namespace PepLib.Models
|
||||
{
|
||||
public partial class Report
|
||||
{
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
namespace PepLib
|
||||
|
||||
namespace PepLib.Models
|
||||
{
|
||||
public partial class Report
|
||||
{
|
||||
@@ -1,6 +1,6 @@
|
||||
using PepLib.IO;
|
||||
using PepLib.IO;
|
||||
|
||||
namespace PepLib
|
||||
namespace PepLib.Models
|
||||
{
|
||||
public partial class Report
|
||||
{
|
||||
@@ -118,4 +118,4 @@ namespace PepLib
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace PepLib
|
||||
namespace PepLib.Utilities
|
||||
{
|
||||
public static class AngleConverter
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace PepLib
|
||||
namespace PepLib.Utilities
|
||||
{
|
||||
public static class Generic
|
||||
{
|
||||
@@ -1,4 +1,6 @@
|
||||
namespace PepLib
|
||||
using PepLib.Geometry;
|
||||
|
||||
namespace PepLib.Utilities
|
||||
{
|
||||
public class IniConfig
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace PepLib
|
||||
namespace PepLib.Utilities
|
||||
{
|
||||
public static class MathHelper
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace PepLib
|
||||
namespace PepLib.Utilities
|
||||
{
|
||||
public static class Tolerance
|
||||
{
|
||||
@@ -1,6 +1,6 @@
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace PepLib
|
||||
namespace PepLib.Utilities
|
||||
{
|
||||
public static class Util
|
||||
{
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.IO.Compression;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace PepLib
|
||||
namespace PepLib.Utilities
|
||||
{
|
||||
public static class ZipHelper
|
||||
{
|
||||
@@ -79,4 +79,3 @@ namespace PepLib
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user