refactor: move CutParameters to OpenNest.Api namespace with new properties
Relocates CutParameters from OpenNest namespace to OpenNest.Api, adds LeadInLength and PostProcessor properties, and provides a typed Default factory. Updates Timing.cs, the WinForms project reference, and the three consuming forms to resolve the type from the new namespace. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,15 +1,21 @@
|
||||
using System;
|
||||
using System;
|
||||
|
||||
namespace OpenNest
|
||||
namespace OpenNest.Api;
|
||||
|
||||
public class CutParameters
|
||||
{
|
||||
public class CutParameters
|
||||
public double Feedrate { get; set; }
|
||||
public double RapidTravelRate { get; set; }
|
||||
public TimeSpan PierceTime { get; set; }
|
||||
public double LeadInLength { get; set; }
|
||||
public string PostProcessor { get; set; }
|
||||
public Units Units { get; set; }
|
||||
|
||||
public static CutParameters Default => new()
|
||||
{
|
||||
public double Feedrate { get; set; }
|
||||
|
||||
public double RapidTravelRate { get; set; }
|
||||
|
||||
public TimeSpan PierceTime { get; set; }
|
||||
|
||||
public Units Units { get; set; }
|
||||
}
|
||||
Feedrate = 100,
|
||||
RapidTravelRate = 300,
|
||||
PierceTime = TimeSpan.FromSeconds(0.5),
|
||||
Units = OpenNest.Units.Inches
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using OpenNest.Api;
|
||||
using OpenNest.CNC;
|
||||
using OpenNest.Converters;
|
||||
using OpenNest.Geometry;
|
||||
|
||||
35
OpenNest.Tests/Api/CutParametersTests.cs
Normal file
35
OpenNest.Tests/Api/CutParametersTests.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using OpenNest.Api;
|
||||
|
||||
namespace OpenNest.Tests.Api;
|
||||
|
||||
public class CutParametersTests
|
||||
{
|
||||
[Fact]
|
||||
public void Default_HasExpectedValues()
|
||||
{
|
||||
var cp = CutParameters.Default;
|
||||
|
||||
Assert.Equal(100, cp.Feedrate);
|
||||
Assert.Equal(300, cp.RapidTravelRate);
|
||||
Assert.Equal(TimeSpan.FromSeconds(0.5), cp.PierceTime);
|
||||
Assert.Equal(Units.Inches, cp.Units);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Properties_AreSettable()
|
||||
{
|
||||
var cp = new CutParameters
|
||||
{
|
||||
Feedrate = 200,
|
||||
RapidTravelRate = 500,
|
||||
PierceTime = TimeSpan.FromSeconds(1.0),
|
||||
LeadInLength = 0.25,
|
||||
PostProcessor = "CL-707",
|
||||
Units = Units.Millimeters
|
||||
};
|
||||
|
||||
Assert.Equal(200, cp.Feedrate);
|
||||
Assert.Equal(0.25, cp.LeadInLength);
|
||||
Assert.Equal("CL-707", cp.PostProcessor);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using OpenNest.Api;
|
||||
|
||||
namespace OpenNest.Forms
|
||||
{
|
||||
|
||||
@@ -5,6 +5,7 @@ using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using OpenNest.Api;
|
||||
using OpenNest.Actions;
|
||||
using OpenNest.CNC.CuttingStrategy;
|
||||
using OpenNest.Collections;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using OpenNest.Api;
|
||||
|
||||
namespace OpenNest.Forms
|
||||
{
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
<Compile Remove="Controls\LayoutViewGL.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\OpenNest.Api\OpenNest.Api.csproj" />
|
||||
<ProjectReference Include="..\OpenNest.Core\OpenNest.Core.csproj" />
|
||||
<ProjectReference Include="..\OpenNest.Engine\OpenNest.Engine.csproj" />
|
||||
<ProjectReference Include="..\OpenNest.Gpu\OpenNest.Gpu.csproj" />
|
||||
|
||||
Reference in New Issue
Block a user