-
Notifications
You must be signed in to change notification settings - Fork 0
/
BuildSettings.cs
51 lines (36 loc) · 1.44 KB
/
BuildSettings.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace MillPlane
{
[Serializable]
public class BuildSettings
{
[Required]
[Range(0.0001, Double.MaxValue, ErrorMessage = "Tool diameter must be greater than 0")]
public double ToolDiameter { get; set; } = 1.0;
[Required]
[Range(0.0001, Double.MaxValue, ErrorMessage = "Depth must be greater than 0")]
public double Depth { get; set; } = 0.0625;
[Range(1, Int32.MaxValue, ErrorMessage = "RPM must be greater than 0")]
public int Rpm { get; set; } = 12000;
[Range(0.0001, Double.MaxValue, ErrorMessage = "Feed rate must be greater than 0")]
public double Feed { get; set; } = 30.0;
public double StepOver { get; set; }
public double StepDown { get; set; }
public double MaterialWidth { get; set; }
public double MaterialHeight { get; set; }
[JsonIgnore]
public double ToolRadius => ToolDiameter / 2;
[JsonIgnore]
public double XStart => (0 - ToolRadius);
[JsonIgnore]
public double XEnd => (Width + ToolRadius);
[JsonIgnore]
public double Height => (MaterialHeight < ToolDiameter) ? ToolDiameter : MaterialHeight;
[JsonIgnore]
public double Width => (MaterialWidth < ToolDiameter) ? ToolDiameter : MaterialWidth;
public BuildSettings()
{
}
}
}