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"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</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);
}
}
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,8 +1,7 @@
using System.Reflection;
using System.Runtime.CompilerServices;
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
// associated with an assembly.
[assembly: AssemblyTitle("CutList")]
@@ -14,8 +13,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 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
// 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
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
@@ -25,12 +24,12 @@ using System.Runtime.InteropServices;
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Minor Version
// Build Number
// 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:
// [assembly: AssemblyVersion("1.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;
}
}
}
}

View File

@@ -1,7 +1,6 @@
using System;
using System.Text.RegularExpressions;
using System.Text;
using SawCut;
using System.Text.RegularExpressions;
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";
}
}
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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