This commit is contained in:
AJ
2021-10-07 09:12:38 -04:00
parent 5af1daac11
commit fc557d2500
22 changed files with 45 additions and 62 deletions

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup> </startup>
</configuration> </configuration>

View File

@@ -79,4 +79,4 @@ namespace CutList.Controls
e.Graphics.DrawRectangle(Pens.Black, rect.X, rect.Y, rect.Width, rect.Height); e.Graphics.DrawRectangle(Pens.Black, rect.X, rect.Y, rect.Width, rect.Height);
} }
} }
} }

View File

@@ -5,7 +5,7 @@ namespace CutList.Forms
{ {
public static class DataGridViewExtensions public static class DataGridViewExtensions
{ {
static readonly StringFormat CenterVerticallyFormat = new StringFormat private static readonly StringFormat CenterVerticallyFormat = new StringFormat
{ {
Alignment = StringAlignment.Far, Alignment = StringAlignment.Far,
LineAlignment = StringAlignment.Center LineAlignment = StringAlignment.Center
@@ -25,7 +25,6 @@ namespace CutList.Forms
headerBounds, headerBounds,
CenterVerticallyFormat); CenterVerticallyFormat);
}; };
} }
} }
} }

View File

@@ -2,11 +2,9 @@
using Newtonsoft.Json; using Newtonsoft.Json;
using SawCut; using SawCut;
using SawCut.Nesting; using SawCut.Nesting;
using SimpleExpressionEvaluator;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Diagnostics;
using System.Drawing; using System.Drawing;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
@@ -278,7 +276,6 @@ namespace CutList.Forms
private void dataGridView2_CellContentClick(object sender, DataGridViewCellEventArgs e) private void dataGridView2_CellContentClick(object sender, DataGridViewCellEventArgs e)
{ {
} }
private void dataGridView2_CellEndEdit(object sender, DataGridViewCellEventArgs e) private void dataGridView2_CellEndEdit(object sender, DataGridViewCellEventArgs e)
@@ -287,4 +284,4 @@ namespace CutList.Forms
dataGridView2.Refresh(); dataGridView2.Refresh();
} }
} }
} }

View File

@@ -1,14 +1,9 @@
using SawCut; using SawCut;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics; using System.Diagnostics;
using System.Drawing;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
namespace CutList.Forms namespace CutList.Forms
@@ -49,7 +44,7 @@ namespace CutList.Forms
s.FileName = name; s.FileName = name;
s.Filter = "Text File|*.txt"; s.Filter = "Text File|*.txt";
if (s.ShowDialog() != DialogResult.OK) if (s.ShowDialog() != DialogResult.OK)
{ {
return; return;
@@ -93,4 +88,4 @@ namespace CutList.Forms
Process.Start(file); Process.Start(file);
} }
} }
} }

View File

@@ -4,7 +4,7 @@ using System.Windows.Forms;
namespace CutList namespace CutList
{ {
static class Helper internal static class Helper
{ {
public static double GetLengthInches(TextBox tb) public static double GetLengthInches(TextBox tb)
{ {
@@ -20,7 +20,6 @@ namespace CutList
var x = ArchUnits.ParseToInches(tb.Text); var x = ArchUnits.ParseToInches(tb.Text);
tb.ForeColor = SystemColors.WindowText; tb.ForeColor = SystemColors.WindowText;
return x; return x;
} }
catch catch
{ {
@@ -29,4 +28,4 @@ namespace CutList
} }
} }
} }
} }

View File

@@ -53,9 +53,9 @@ namespace CutList.Models
public string TotalLengthString public string TotalLengthString
{ {
get get
{ {
return TotalLength.HasValue ? ArchUnits.FormatFromInches(TotalLength.Value) : "-"; return TotalLength.HasValue ? ArchUnits.FormatFromInches(TotalLength.Value) : "-";
} }
} }
@@ -63,4 +63,4 @@ namespace CutList.Models
public int Priority { get; set; } = 10; public int Priority { get; set; } = 10;
} }
} }

View File

@@ -42,17 +42,17 @@ namespace CutList.Models
[JsonIgnore] [JsonIgnore]
public double? TotalLength public double? TotalLength
{ {
get get
{ {
var length = Length; var length = Length;
if (length == null) if (length == null)
return null; return null;
return Math.Round(length.Value * Quantity, 8); return Math.Round(length.Value * Quantity, 8);
} }
} }
public int Quantity { get; set; } = 1; public int Quantity { get; set; } = 1;
} }
} }

View File

@@ -1,22 +1,19 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
namespace CutList namespace CutList
{ {
static class Program internal static class Program
{ {
/// <summary> /// <summary>
/// The main entry point for the application. /// The main entry point for the application.
/// </summary> /// </summary>
[STAThread] [STAThread]
static void Main() private static void Main()
{ {
Application.EnableVisualStyles(); Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false); Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Forms.MainForm()); Application.Run(new Forms.MainForm());
} }
} }
} }

View File

@@ -1,8 +1,7 @@
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
[assembly: AssemblyTitle("CutList")] [assembly: AssemblyTitle("CutList")]
@@ -14,8 +13,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible // Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from // to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type. // COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)] [assembly: ComVisible(false)]
@@ -25,12 +24,12 @@ using System.Runtime.InteropServices;
// Version information for an assembly consists of the following four values: // Version information for an assembly consists of the following four values:
// //
// Major Version // Major Version
// Minor Version // Minor Version
// Build Number // Build Number
// Revision // Revision
// //
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -13,4 +13,4 @@
return Name; return Name;
} }
} }
} }

View File

@@ -1,7 +1,6 @@
using System; using System;
using System.Text.RegularExpressions;
using System.Text; using System.Text;
using SawCut; using System.Text.RegularExpressions;
namespace SawCut namespace SawCut
{ {
@@ -73,4 +72,4 @@ namespace SawCut
} }
} }
} }
} }

View File

@@ -45,4 +45,4 @@ namespace SawCut
return $"Length: {totalLength}, {remainingLength} remaining, {Items.Count} items, {utilitation}% utilization"; return $"Length: {totalLength}, {remainingLength} remaining, {Items.Count} items, {utilitation}% utilization";
} }
} }
} }

View File

@@ -6,4 +6,4 @@
public double Length { get; set; } public double Length { get; set; }
} }
} }

View File

@@ -1,7 +1,7 @@
using System; using System;
using System.Text.RegularExpressions;
using System.Text;
using System.Linq; using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
namespace SawCut namespace SawCut
{ {
@@ -82,4 +82,4 @@ namespace SawCut
return true; return true;
} }
} }
} }

View File

@@ -8,4 +8,4 @@
public int Priority { get; set; } public int Priority { get; set; }
} }
} }

View File

@@ -103,4 +103,4 @@ namespace SawCut.Nesting
return (found != null); return (found != null);
} }
} }
} }

View File

@@ -57,7 +57,7 @@ namespace SawCut.Nesting
FillBin(bin); FillBin(bin);
int count = 0; int count = 0;
while (TryImprovePacking(bin)) while (TryImprovePacking(bin))
{ {
count++; count++;
@@ -71,7 +71,7 @@ namespace SawCut.Nesting
.ThenBy(b => b.Items.Count) .ThenBy(b => b.Items.Count)
.ToList(); .ToList();
} }
private void FillBin(Bin bin) private void FillBin(Bin bin)
{ {
for (int i = 0; i < Items.Count; i++) for (int i = 0; i < Items.Count; i++)
@@ -155,4 +155,4 @@ namespace SawCut.Nesting
return false; return false;
} }
} }
} }

View File

@@ -6,4 +6,4 @@ namespace SawCut.Nesting
{ {
Result Pack(List<BinItem> items); Result Pack(List<BinItem> items);
} }
} }

View File

@@ -1,5 +1,4 @@
using System; using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq; using System.Linq;
namespace SawCut.Nesting namespace SawCut.Nesting
@@ -67,4 +66,4 @@ namespace SawCut.Nesting
return result; return result;
} }
} }
} }

View File

@@ -14,4 +14,4 @@ namespace SawCut.Nesting
public List<Bin> Bins { get; set; } public List<Bin> Bins { get; set; }
} }
} }

View File

@@ -1,5 +1,4 @@
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
@@ -33,4 +32,4 @@ using System.Runtime.InteropServices;
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]