diff --git a/AutoCut.Core.UnitTests/AutoCut.Core.UnitTests.csproj b/AutoCut.Core.UnitTests/AutoCut.Core.UnitTests.csproj deleted file mode 100644 index 10f5555..0000000 --- a/AutoCut.Core.UnitTests/AutoCut.Core.UnitTests.csproj +++ /dev/null @@ -1,29 +0,0 @@ - - - - net7.0 - enable - enable - - false - - - - - - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - - - - - - diff --git a/AutoCut.Core.UnitTests/GlobalUsings.cs b/AutoCut.Core.UnitTests/GlobalUsings.cs deleted file mode 100644 index 8c927eb..0000000 --- a/AutoCut.Core.UnitTests/GlobalUsings.cs +++ /dev/null @@ -1 +0,0 @@ -global using Xunit; \ No newline at end of file diff --git a/AutoCut.Core.UnitTests/Optimization/OptimizerTests.cs b/AutoCut.Core.UnitTests/Optimization/OptimizerTests.cs deleted file mode 100644 index 950f133..0000000 --- a/AutoCut.Core.UnitTests/Optimization/OptimizerTests.cs +++ /dev/null @@ -1,194 +0,0 @@ -using AutoCut.Core.Models; -using AutoCut.Core.Optimization; -using FluentAssertions; - -namespace AutoCut.Core.UnitTests.Optimization; - -public class OptimizerTests -{ - [Fact] - public void NoPanels() - { - // arrange - var sheet = Sheet.Default; - var optimizer = new Optimizer(); - - // act - var actual = optimizer.Optimize(sheet, new List(), new OptimizerOptions()); - - // assert - actual.OptimizedSheets.Should().BeEmpty(); - } - - [Fact] - public void SinglePanel() - { - var panels = new List - { - new(100, 100, EdgeReduction.NoEdges) - }; - var sheet = Sheet.Default; - var optimizer = new Optimizer(); - - var actual = optimizer.Optimize(sheet, panels, new OptimizerOptions()); - - actual.OptimizedSheets.Single().Panels.Should() - .ContainSingle("", new OptimizedPanel(panels.First(), 0, 0)); - actual.OptimizedSheets.Should().ContainSingle(); - } - - [Fact] - public void OneRow() - { - var panels = new List - { - new(100, 200, EdgeReduction.NoEdges), - new(100, 200, EdgeReduction.NoEdges), - new(100, 200, EdgeReduction.NoEdges), - new(100, 200, EdgeReduction.NoEdges), - }; - var sheet = Sheet.Default; - var optimizer = new Optimizer(); - - var actual = optimizer.Optimize(sheet, panels, new OptimizerOptions()); - - actual.OptimizedSheets.Single().Panels.Should() - .BeEquivalentTo( - new List - { - new(panels[0], 0, 0), - new(panels[1], 100, 0), - new(panels[2], 200, 0), - new(panels[3], 300, 0) - }); - } - - [Fact] - public void OneRowIncludingBlade() - { - var panels = new List - { - new(100, 200, EdgeReduction.NoEdges), - new(100, 200, EdgeReduction.NoEdges), - new(100, 200, EdgeReduction.NoEdges) - }; - var sheet = Sheet.Default; - var optimizer = new Optimizer(); - var options = new OptimizerOptions { BladeThickness = 3 }; - - var actual = optimizer.Optimize(sheet, panels, options); - - actual.Options.BladeThickness.Should().Be(3); - actual.OptimizedSheets.Single().Panels.Should() - .BeEquivalentTo( - new List - { - new(panels[0], 0, 0), - new(panels[1], 103, 0), - new(panels[2], 206, 0) - }); - } - - [Fact] - public void OneRowDifferentSizes() - { - var panels = new List - { - new(100, 200, EdgeReduction.NoEdges), - new(100, 200, EdgeReduction.NoEdges), - new(50, 50, EdgeReduction.NoEdges), - new(50, 50, EdgeReduction.NoEdges) - }; - var sheet = Sheet.Default; - var optimizer = new Optimizer(); - - var actual = optimizer.Optimize(sheet, panels, new OptimizerOptions()); - - actual.OptimizedSheets.Single().Panels.Should() - .BeEquivalentTo( - new List - { - new(panels[0], 0, 0), - new(panels[1], 100, 0), - new(panels[2], 200, 0), - new(panels[3], 250, 0) - }); - } - - [Fact] - public void MultipleRows() - { - var panels = new List - { - new(new Panel(100, 200, EdgeReduction.NoEdges), 5) - }; - var sheet = new Sheet(210, 2000, EdgeReduction.NoEdges, 10); - var optimizer = new Optimizer(); - - var actual = optimizer.Optimize(sheet, panels, new OptimizerOptions()); - - var expectedPanel = panels.First().Decompress().First(); - actual.OptimizedSheets.Single().Panels.Should() - .BeEquivalentTo( - new List - { - new(expectedPanel, 0, 0), - new(expectedPanel, 100, 0), - new(expectedPanel, 0, 200), - new(expectedPanel, 100, 200), - new(expectedPanel, 0, 400) - }); - } - - [Fact] - public void MultipleRowsMultipleSizes() - { - var panels = new List - { - new(new Panel(100, 100, EdgeReduction.NoEdges), 5), - new(new Panel(50, 50, EdgeReduction.NoEdges), 3) - }; - var sheet = new Sheet(300, 300, EdgeReduction.NoEdges, 10); - var optimizer = new Optimizer(); - - var actual = optimizer.Optimize(sheet, panels, new OptimizerOptions()); - - var expectedPanel1 = panels.First().Decompress().First(); - var expectedPanel2 = panels.Last().Decompress().First(); - actual.OptimizedSheets.Single().Panels.Should() - .BeEquivalentTo(new List - { - new(expectedPanel1, 0, 0), - new(expectedPanel1, 100, 0), - new(expectedPanel1, 200, 0), - new(expectedPanel1, 0, 100), - new(expectedPanel1, 100, 100), - - new(expectedPanel2, 200, 100), - new(expectedPanel2, 250, 100), - new(expectedPanel2, 200, 150) - }); - } - - [Fact] - public void MultipleSheets() - { - var panels = new List - { - new(new Panel(100, 100, EdgeReduction.NoEdges), 3) - }; - var sheet = new Sheet(110, 120, EdgeReduction.NoEdges, 10); - var optimizer = new Optimizer(); - - var actual = optimizer.Optimize(sheet, panels, new OptimizerOptions()); - - var expectedPanel = panels.First().Decompress().First(); - actual.OptimizedSheets.Should().HaveCount(3); - foreach (var optimizedSheet in actual.OptimizedSheets) - { - optimizedSheet.Panels - .Should().ContainSingle("", - new OptimizedPanel(expectedPanel, 0, 0)); - } - } -} \ No newline at end of file diff --git a/AutoCut.Core/AutoCut.Core.csproj b/AutoCut.Core/AutoCut.Core.csproj deleted file mode 100644 index 6836c68..0000000 --- a/AutoCut.Core/AutoCut.Core.csproj +++ /dev/null @@ -1,9 +0,0 @@ - - - - net7.0 - enable - enable - - - diff --git a/AutoCut.Core/Models/CompressedPanel.cs b/AutoCut.Core/Models/CompressedPanel.cs deleted file mode 100644 index 405b737..0000000 --- a/AutoCut.Core/Models/CompressedPanel.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace AutoCut.Core.Models; - -public class CompressedPanel -{ - public Panel Panel { get; } - - public int Quantity { get; set; } - - public CompressedPanel(Panel panel, int quantity) - { - Panel = panel; - Quantity = quantity; - } - - public IEnumerable Decompress() => - Enumerable.Repeat(Panel, Quantity); - - public static CompressedPanel Default => new CompressedPanel(Panel.Default, 0); -} \ No newline at end of file diff --git a/AutoCut.Core/Models/EdgeReduction.cs b/AutoCut.Core/Models/EdgeReduction.cs deleted file mode 100644 index 81278b9..0000000 --- a/AutoCut.Core/Models/EdgeReduction.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.ComponentModel.DataAnnotations; - -namespace AutoCut.Core.Models; - -public class EdgeReduction -{ - [Range(0, 2)] public int EdgesAlongLenght { get; set; } - - [Range(0, 2)] public int EdgesAlongWidth { get; set; } - - public EdgeReduction(int edgesAlongLenght, int edgesAlongWidth) - { - if (edgesAlongLenght is < 0 or > 2) - throw new ArgumentOutOfRangeException(nameof(edgesAlongLenght)); - if (edgesAlongWidth is < 0 or > 2) - throw new ArgumentOutOfRangeException(nameof(edgesAlongWidth)); - - EdgesAlongLenght = edgesAlongLenght; - EdgesAlongWidth = edgesAlongWidth; - } - - public static EdgeReduction AllEdges => new EdgeReduction(2, 2); - public static EdgeReduction NoEdges => new EdgeReduction(0, 0); -} \ No newline at end of file diff --git a/AutoCut.Core/Models/Interfaces/IPosition.cs b/AutoCut.Core/Models/Interfaces/IPosition.cs deleted file mode 100644 index 654df89..0000000 --- a/AutoCut.Core/Models/Interfaces/IPosition.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace AutoCut.Core.Models.Interfaces; - -public interface IPosition -{ - public decimal X { get; set; } - public decimal Y { get; set; } -} \ No newline at end of file diff --git a/AutoCut.Core/Models/Interfaces/IRectangle.cs b/AutoCut.Core/Models/Interfaces/IRectangle.cs deleted file mode 100644 index 4a8f789..0000000 --- a/AutoCut.Core/Models/Interfaces/IRectangle.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace AutoCut.Core.Models.Interfaces; - -public interface IRectangle -{ - public decimal Length { get; set; } - public decimal Width { get; set; } -} \ No newline at end of file diff --git a/AutoCut.Core/Models/OptimizedPanel.cs b/AutoCut.Core/Models/OptimizedPanel.cs deleted file mode 100644 index 4b1da05..0000000 --- a/AutoCut.Core/Models/OptimizedPanel.cs +++ /dev/null @@ -1,19 +0,0 @@ -using AutoCut.Core.Models.Interfaces; - -namespace AutoCut.Core.Models; - -public class OptimizedPanel : IPosition -{ - public Panel Panel { get; } - - public decimal X { get; set; } - - public decimal Y { get; set; } - - public OptimizedPanel(Panel panel, decimal x, decimal y) - { - Panel = panel; - X = x; - Y = y; - } -} \ No newline at end of file diff --git a/AutoCut.Core/Models/OptimizedSheet.cs b/AutoCut.Core/Models/OptimizedSheet.cs deleted file mode 100644 index d02c184..0000000 --- a/AutoCut.Core/Models/OptimizedSheet.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace AutoCut.Core.Models; - -public class OptimizedSheet -{ - public Sheet Sheet { get; } - - public List Panels { get; } - - public OptimizedSheet(Sheet sheet, List panels) - { - Sheet = sheet; - Panels = panels; - } - - public static OptimizedSheet Empty(Sheet sheet) => - new OptimizedSheet(sheet, new List()); -} \ No newline at end of file diff --git a/AutoCut.Core/Models/Panel.cs b/AutoCut.Core/Models/Panel.cs deleted file mode 100644 index e6e4095..0000000 --- a/AutoCut.Core/Models/Panel.cs +++ /dev/null @@ -1,24 +0,0 @@ -using AutoCut.Core.Models.Interfaces; - -namespace AutoCut.Core.Models; - -public class Panel : IRectangle -{ - public decimal Length { get; set; } - - public decimal Width { get; set; } - - public EdgeReduction EdgeReduction { get; set; } - - public string Name { get; set; } - - public Panel(decimal length, decimal width, EdgeReduction edgeReduction, string name = "") - { - Length = length; - Width = width; - EdgeReduction = edgeReduction; - Name = name; - } - - public static Panel Default => new(1, 1, EdgeReduction.NoEdges); -} \ No newline at end of file diff --git a/AutoCut.Core/Models/Sheet.cs b/AutoCut.Core/Models/Sheet.cs deleted file mode 100644 index f18d6e0..0000000 --- a/AutoCut.Core/Models/Sheet.cs +++ /dev/null @@ -1,25 +0,0 @@ -using AutoCut.Core.Models.Interfaces; - -namespace AutoCut.Core.Models; - -public class Sheet : IRectangle -{ - public decimal Length { get; set; } - - public decimal Width { get; set; } - - public EdgeReduction EdgeReduction { get; set; } - - public decimal Thickness { get; set; } - - public Sheet(decimal length, decimal width, EdgeReduction edgeReduction, decimal thickness) - { - Length = length; - Width = width; - EdgeReduction = edgeReduction; - Thickness = thickness; - } - - public static Sheet Default => - new Sheet(2800, 2070, EdgeReduction.NoEdges, 18); -} \ No newline at end of file diff --git a/AutoCut.Core/Optimization/FreeSpace.cs b/AutoCut.Core/Optimization/FreeSpace.cs deleted file mode 100644 index 08f20b2..0000000 --- a/AutoCut.Core/Optimization/FreeSpace.cs +++ /dev/null @@ -1,48 +0,0 @@ -using AutoCut.Core.Models; -using AutoCut.Core.Models.Interfaces; - -namespace AutoCut.Core.Optimization; - -public class FreeSpace : IPosition, IRectangle, IComparable, IComparable -{ - public decimal X { get; set; } - - public decimal Y { get; set; } - - public decimal Length { get; set; } - - public decimal Width { get; set; } - - public OptimizedSheet Sheet { get; } - - public FreeSpace(decimal x, decimal y, decimal length, decimal width, OptimizedSheet sheet) - { - X = x; - Y = y; - Length = length; - Width = width; - Sheet = sheet; - } - - public int CompareTo(FreeSpace? other) - { - if (ReferenceEquals(this, other)) return 0; - if (ReferenceEquals(null, other)) return 1; - var lengthComparison = - Length.CompareTo(other.Length); - return lengthComparison == 0 - ? Width.CompareTo(other.Width) - : lengthComparison; - } - - public int CompareTo(object? obj) - { - if (ReferenceEquals(null, obj)) return 1; - if (ReferenceEquals(this, obj)) return 0; - return obj is FreeSpace other - ? CompareTo(other) - : throw new ArgumentException($"Object must be of type {nameof(FreeSpace)}"); - } - - public FreeSpace Clone() => new(X, Y, Length, Width, Sheet); -} \ No newline at end of file diff --git a/AutoCut.Core/Optimization/OptimizationResult.cs b/AutoCut.Core/Optimization/OptimizationResult.cs deleted file mode 100644 index 4dbd0d2..0000000 --- a/AutoCut.Core/Optimization/OptimizationResult.cs +++ /dev/null @@ -1,5 +0,0 @@ -using AutoCut.Core.Models; - -namespace AutoCut.Core.Optimization; - -public record OptimizationResult(OptimizerOptions Options, List OptimizedSheets); \ No newline at end of file diff --git a/AutoCut.Core/Optimization/Optimizer.cs b/AutoCut.Core/Optimization/Optimizer.cs deleted file mode 100644 index df69531..0000000 --- a/AutoCut.Core/Optimization/Optimizer.cs +++ /dev/null @@ -1,95 +0,0 @@ -using AutoCut.Core.Models; -using AutoCut.Core.Models.Interfaces; - -namespace AutoCut.Core.Optimization; - -public class Optimizer -{ - public OptimizationResult Optimize( - Sheet sheetTemplate, - IEnumerable compressedPanels, - OptimizerOptions options) - { - var panels = compressedPanels.SelectMany(panel => panel.Decompress()); - return Optimize(sheetTemplate, panels, options); - } - - public OptimizationResult Optimize( - Sheet sheetTemplate, - IEnumerable panels, - OptimizerOptions options) - { - // TODO: check if list or enumerable is faster in freeRectangles than sorted set - var freeRectangles = new SortedSet(); - var panelsToProcess = panels - .OrderByDescending(p => p.Length) - .ThenByDescending(p => p.Width) - .ToList(); - var optimizedSheets = new List(); - - foreach (var panel in panelsToProcess) - { - // extract smallest fit, if there is none, create new stock panel - var fit = freeRectangles.FirstOrDefault(freeSpace => - freeSpace.Length >= panel.Length && freeSpace.Width >= panel.Width); - if (fit is null) - { - var newSheet = OptimizedSheet.Empty(sheetTemplate); - optimizedSheets.Add(newSheet); - fit = new FreeSpace(0, 0, sheetTemplate.Length, sheetTemplate.Width, newSheet); - } - else - { - freeRectangles.Remove(fit); - } - - fit.Sheet.Panels.Add(new OptimizedPanel(panel, fit.X, fit.Y)); - - // add new free rectangles - freeRectangles.UnionWith(GenerateNewFreeRectangles(fit, panel, options)); - } - - return new OptimizationResult(options, optimizedSheets); - } - - private static IEnumerable GenerateNewFreeRectangles( - FreeSpace fit, - IRectangle currentPanel, - OptimizerOptions options) - { - if ((fit.Length, fit.Width) == (currentPanel.Length, currentPanel.Width)) - { - // panel fits perfectly 👌 - // so no new free rectangles - } - else if (fit.Length == currentPanel.Length) - { - var result = fit.Clone(); - result.Y = fit.Y + currentPanel.Width + options.BladeThickness; - result.Width = fit.Width - currentPanel.Width; - yield return result; - } - else if (fit.Width == currentPanel.Width) - { - var result = fit.Clone(); - result.X = fit.X + currentPanel.Length + options.BladeThickness; - result.Length = fit.Length - currentPanel.Length; - yield return result; - } - else - { - // prefer horizontal split/cut - - var panelBelow = fit.Clone(); - panelBelow.Y = fit.Y + currentPanel.Width + options.BladeThickness; - panelBelow.Width = fit.Width - currentPanel.Width - options.BladeThickness; - yield return panelBelow; - - var panelToTheRight = fit.Clone(); - panelToTheRight.X = fit.X + currentPanel.Length + options.BladeThickness; - panelToTheRight.Length = fit.Length - currentPanel.Length - options.BladeThickness; - panelToTheRight.Width = currentPanel.Width + options.BladeThickness; - yield return panelToTheRight; - } - } -} \ No newline at end of file diff --git a/AutoCut.Core/Optimization/OptimizerOptions.cs b/AutoCut.Core/Optimization/OptimizerOptions.cs deleted file mode 100644 index b218451..0000000 --- a/AutoCut.Core/Optimization/OptimizerOptions.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace AutoCut.Core.Optimization; - -public class OptimizerOptions -{ - /// - /// Blade thickness in mm - /// - public decimal BladeThickness { get; set; } - - /// - /// Edge banding thickness in mm - /// - public decimal PanelEdgeReductionThickness { get; set; } - - /// - /// Stock panel edge cutting thickness in mm - /// - public decimal SheetEdgeReductionThickness { get; set; } -} \ No newline at end of file diff --git a/AutoCut.Frontend/App.razor b/AutoCut.Frontend/App.razor deleted file mode 100644 index 9b9b4ff..0000000 --- a/AutoCut.Frontend/App.razor +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - Not found - -

Sorry, there's nothing at this address.

-
-
-
\ No newline at end of file diff --git a/AutoCut.Frontend/AutoCut.Frontend.csproj b/AutoCut.Frontend/AutoCut.Frontend.csproj deleted file mode 100644 index eea0c90..0000000 --- a/AutoCut.Frontend/AutoCut.Frontend.csproj +++ /dev/null @@ -1,68 +0,0 @@ - - - - net7.0 - enable - enable - service-worker-assets.js - true - - - - - - - - - - - - - - - - - - - <_ContentIncludedByDefault Remove="wwwroot\css\open-iconic\FONT-LICENSE"/> - <_ContentIncludedByDefault Remove="wwwroot\css\open-iconic\font\css\open-iconic-bootstrap.min.css"/> - <_ContentIncludedByDefault Remove="wwwroot\css\open-iconic\font\fonts\open-iconic.eot"/> - <_ContentIncludedByDefault Remove="wwwroot\css\open-iconic\font\fonts\open-iconic.otf"/> - <_ContentIncludedByDefault Remove="wwwroot\css\open-iconic\font\fonts\open-iconic.svg"/> - <_ContentIncludedByDefault Remove="wwwroot\css\open-iconic\font\fonts\open-iconic.ttf"/> - <_ContentIncludedByDefault Remove="wwwroot\css\open-iconic\font\fonts\open-iconic.woff"/> - <_ContentIncludedByDefault Remove="wwwroot\css\open-iconic\ICON-LICENSE"/> - <_ContentIncludedByDefault Remove="wwwroot\css\open-iconic\README.md"/> - <_ContentIncludedByDefault Remove="wwwroot\sample-data\weather.json"/> - <_ContentIncludedByDefault Remove="Components\AddPanel\AddPanel.razor"/> - <_ContentIncludedByDefault Remove="Components\ActionButtons\ActionButtons.razor"/> - <_ContentIncludedByDefault Remove="Components\Panels\Panels.razor"/> - <_ContentIncludedByDefault Remove="Components\Tables\Tables.razor"/> - <_ContentIncludedByDefault Remove="Components\Visualization\CurrentVisualization.razor"/> - <_ContentIncludedByDefault Remove="Components\Visualization\SvgVisualization.razor"/> - <_ContentIncludedByDefault Remove="Components\Visualization\VisualizationList.razor"/> - <_ContentIncludedByDefault Remove="Components\AddPanel\Input.razor"/> - <_ContentIncludedByDefault Remove="Components\AppBar\AppBar.razor"/> - <_ContentIncludedByDefault Remove="Components\Cuts\Cuts.razor"/> - - - - - - - - - ResXFileCodeGenerator - GlobalResources.Designer.cs - - - - - - True - True - tempname.resx - - - - diff --git a/AutoCut.Frontend/Layouts/MainLayout.razor b/AutoCut.Frontend/Layouts/MainLayout.razor deleted file mode 100644 index 883abfc..0000000 --- a/AutoCut.Frontend/Layouts/MainLayout.razor +++ /dev/null @@ -1,6 +0,0 @@ -@inherits LayoutComponentBase - -
- - @Body -
\ No newline at end of file diff --git a/AutoCut.Frontend/Layouts/MainLayout.razor.css b/AutoCut.Frontend/Layouts/MainLayout.razor.css deleted file mode 100644 index 8f0da7c..0000000 --- a/AutoCut.Frontend/Layouts/MainLayout.razor.css +++ /dev/null @@ -1,15 +0,0 @@ -.color-provider { - --background: #0d0d0d; - --card-background: #1c1c1e; - --bright-background: #2a2a2c; - --bright-border: #4b4b4c; - --card-border: #252527; - - --primary: #a3e635; - --primary-alt: #32cd32; - --error: hsl(5, 78%, 55%); - --error-alt: hsl(5, 78%, 45%); - - --text: white; - --text-gray: #767676; -} diff --git a/AutoCut.Frontend/Localization/GlobalResources.Designer.cs b/AutoCut.Frontend/Localization/GlobalResources.Designer.cs deleted file mode 100644 index f6080f1..0000000 --- a/AutoCut.Frontend/Localization/GlobalResources.Designer.cs +++ /dev/null @@ -1,278 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace AutoCut.Frontend.Localization { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class GlobalResources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal GlobalResources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AutoCut.Frontend.Localization.GlobalResources", typeof(GlobalResources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to Add. - /// - internal static string Add { - get { - return ResourceManager.GetString("Add", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to All. - /// - internal static string All { - get { - return ResourceManager.GetString("All", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Blade. - /// - internal static string Blade { - get { - return ResourceManager.GetString("Blade", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Bottom. - /// - internal static string Bottom { - get { - return ResourceManager.GetString("Bottom", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cuts. - /// - internal static string Cuts { - get { - return ResourceManager.GetString("Cuts", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Edge reduction thickness. - /// - internal static string EdgeReductionThickness { - get { - return ResourceManager.GetString("EdgeReductionThickness", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Individual. - /// - internal static string Individual { - get { - return ResourceManager.GetString("Individual", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Left. - /// - internal static string Left { - get { - return ResourceManager.GetString("Left", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Length. - /// - internal static string Length { - get { - return ResourceManager.GetString("Length", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Name. - /// - internal static string Name { - get { - return ResourceManager.GetString("Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Panel list is empty. Add a new panel to see it here.. - /// - internal static string NoPanelsInfo { - get { - return ResourceManager.GetString("NoPanelsInfo", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Optimize. - /// - internal static string Optimize { - get { - return ResourceManager.GetString("Optimize", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Other. - /// - internal static string Other { - get { - return ResourceManager.GetString("Other", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Panels. - /// - internal static string Panels { - get { - return ResourceManager.GetString("Panels", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Quantity. - /// - internal static string Quantity { - get { - return ResourceManager.GetString("Quantity", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Reset. - /// - internal static string Reset { - get { - return ResourceManager.GetString("Reset", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Reset panels. - /// - internal static string ResetPanels { - get { - return ResourceManager.GetString("ResetPanels", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Right. - /// - internal static string Right { - get { - return ResourceManager.GetString("Right", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Save. - /// - internal static string Save { - get { - return ResourceManager.GetString("Save", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Settings. - /// - internal static string Settings { - get { - return ResourceManager.GetString("Settings", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Sheet. - /// - internal static string Sheet { - get { - return ResourceManager.GetString("Sheet", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Thickness. - /// - internal static string Thickness { - get { - return ResourceManager.GetString("Thickness", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Top. - /// - internal static string Top { - get { - return ResourceManager.GetString("Top", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Width. - /// - internal static string Width { - get { - return ResourceManager.GetString("Width", resourceCulture); - } - } - } -} diff --git a/AutoCut.Frontend/Localization/GlobalResources.pl.resx b/AutoCut.Frontend/Localization/GlobalResources.pl.resx deleted file mode 100644 index c670a58..0000000 --- a/AutoCut.Frontend/Localization/GlobalResources.pl.resx +++ /dev/null @@ -1,90 +0,0 @@ - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, - PublicKeyToken=b77a5c561934e089 - - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, - PublicKeyToken=b77a5c561934e089 - - - - Optymalizuj - - - Resetuj formatki - - - Długość - - - Arkusz - - - Szerokość - - - Grubość - - - Grubość redukcji krawędzi - - - Wszystkie - - - Indywidualnie - - - Góra - - - Lewa - - - Prawa - - - Dół - - - Piła - - - Dodaj - - - Nazwa - - - Ilość - - - Resetuj - - - Lista paneli jest pusta. Dodaj nowy panel, aby zobaczyć go tutaj. - - - Cięcia - - - Formatki - - - Ustawienia - - - Inne - - - Zapisz - - \ No newline at end of file diff --git a/AutoCut.Frontend/Localization/GlobalResources.resx b/AutoCut.Frontend/Localization/GlobalResources.resx deleted file mode 100644 index 42b3fea..0000000 --- a/AutoCut.Frontend/Localization/GlobalResources.resx +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, - PublicKeyToken=b77a5c561934e089 - - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, - PublicKeyToken=b77a5c561934e089 - - - - Optimize - - - Reset panels - - - Sheet - - - Length - - - Width - - - Thickness - - - Edge reduction thickness - - - All - - - Individual - - - Top - - - Left - - - Right - - - Bottom - - - Blade - - - Quantity - - - Name - - - Add - - - Reset - - - Panel list is empty. Add a new panel to see it here. - - - Panels - - - Cuts - - - Settings - - - Other - - - Save - - \ No newline at end of file diff --git a/AutoCut.Frontend/Pages/Index/Components/ActionButtons.razor b/AutoCut.Frontend/Pages/Index/Components/ActionButtons.razor deleted file mode 100644 index 691bd49..0000000 --- a/AutoCut.Frontend/Pages/Index/Components/ActionButtons.razor +++ /dev/null @@ -1,29 +0,0 @@ -@using AutoCut.Frontend.Stores.Panels -@using AutoCut.Frontend.Stores.Panels.Actions -@using AutoCut.Frontend.Stores.Optimization.Actions -@inject IDispatcher Dispatcher -@inject IState PanelsState - -
- - -
- -@code -{ - private void OnOptimize() - { - Dispatcher.Dispatch(new OptimizeAction()); - } - - private void OnReset() - { - Dispatcher.Dispatch(new ResetAction()); - } -} \ No newline at end of file diff --git a/AutoCut.Frontend/Pages/Index/Components/ActionButtons.razor.css b/AutoCut.Frontend/Pages/Index/Components/ActionButtons.razor.css deleted file mode 100644 index 1c9ca77..0000000 --- a/AutoCut.Frontend/Pages/Index/Components/ActionButtons.razor.css +++ /dev/null @@ -1,37 +0,0 @@ -section { - grid-area: action-buttons; - display: flex; - gap: 10px; -} - -button { - color: var(--text); - height: 100%; -} - -button.optimize { - background-image: linear-gradient( - to right, - var(--primary) 0%, - var(--primary-alt) 50%, - var(--primary) 100% - ); - background-size: 200% auto; - transition: background-position 0.2s; -} - -button.optimize:hover { - background-position: right center; -} - -button.optimize:active { - transform: scale(0.95); -} - -button.reset { - background-color: var(--error); -} - -button.reset:active { - transform: scale(0.95); -} diff --git a/AutoCut.Frontend/Pages/Index/Components/AddPanel.razor b/AutoCut.Frontend/Pages/Index/Components/AddPanel.razor deleted file mode 100644 index 3496777..0000000 --- a/AutoCut.Frontend/Pages/Index/Components/AddPanel.razor +++ /dev/null @@ -1,87 +0,0 @@ -@using AutoCut.Core.Models -@using AutoCut.Frontend.Stores.Panels.Actions -@inject IDispatcher Dispatcher - -
-
- - - - -
-
- - - - -
-
- - -
-
- -@code -{ - CompressedPanel _panel = CompressedPanel.Default; - - private void Add() - { - // TODO: Add validation - Dispatcher.Dispatch(new AddAction(_panel)); - - Reset(); - } - - private void Reset() - { - _panel = CompressedPanel.Default; - } -} \ No newline at end of file diff --git a/AutoCut.Frontend/Pages/Index/Components/AddPanel.razor.css b/AutoCut.Frontend/Pages/Index/Components/AddPanel.razor.css deleted file mode 100644 index 0d35651..0000000 --- a/AutoCut.Frontend/Pages/Index/Components/AddPanel.razor.css +++ /dev/null @@ -1,77 +0,0 @@ -section { - grid-area: add-panel; - background-color: var(--card-background); - border: 1px solid var(--card-border); - border-radius: 10px; - display: flex; - justify-content: space-between; - padding: 15px; - gap: 5px; -} - -.edge-buttons { - display: grid; - grid-template: 1fr 1fr / 1fr 1fr; - gap: 15px; -} - -.edge-buttons button { - background-color: inherit; - color: var(--text); - padding: 0; - aspect-ratio: 1 / 1; -} - -::deep .edge-buttons svg { - height: 1.7rem; - width: 1.7rem; -} - -.buttons { - display: flex; - align-items: center; - gap: 5px; -} - -.buttons button { - display: flex; - align-items: center; - gap: 5px; - color: var(--text); -} - -button[type="submit"] { - background-image: linear-gradient( - to right, - var(--primary) 0%, - var(--primary-alt) 50%, - var(--primary) 100% - ); - background-size: 200% auto; - transition: background-position 0.2s; -} - -button[type="submit"]:hover { - background-position: right center; -} - -button[type="submit"]:active { - transform: scale(0.95); -} - -button[type="reset"] { - background-color: var(--error); -} - -button[type="reset"]:active { - transform: scale(0.95); -} - -svg { - height: 1.4rem; -} - -.input-fields { - display: flex; - gap: 5px; -} diff --git a/AutoCut.Frontend/Pages/Index/Components/CurrentVisualization.razor b/AutoCut.Frontend/Pages/Index/Components/CurrentVisualization.razor deleted file mode 100644 index e0510c5..0000000 --- a/AutoCut.Frontend/Pages/Index/Components/CurrentVisualization.razor +++ /dev/null @@ -1,10 +0,0 @@ -@using AutoCut.Frontend.Stores.Optimization -@inherits FluxorComponent -@inject IState OptimizationState - -
- @if (OptimizationState.Value.OptimizedSheets.Any()) - { - - } -
\ No newline at end of file diff --git a/AutoCut.Frontend/Pages/Index/Components/CurrentVisualization.razor.css b/AutoCut.Frontend/Pages/Index/Components/CurrentVisualization.razor.css deleted file mode 100644 index dcc2f7a..0000000 --- a/AutoCut.Frontend/Pages/Index/Components/CurrentVisualization.razor.css +++ /dev/null @@ -1,18 +0,0 @@ -section { - grid-area: current-visualization; - background-color: var(--card-background); - border-radius: 10px; - border: 1px solid var(--card-border); - padding: 15px; - overflow-x: scroll; - overflow-y: hidden; -} - -::deep rect:hover { - cursor: pointer; - fill-opacity: 0.2; -} - -::deep svg { - height: 100%; -} diff --git a/AutoCut.Frontend/Pages/Index/Components/Input.razor b/AutoCut.Frontend/Pages/Index/Components/Input.razor deleted file mode 100644 index b2dde41..0000000 --- a/AutoCut.Frontend/Pages/Index/Components/Input.razor +++ /dev/null @@ -1,47 +0,0 @@ -@typeparam TValue - - - - -@code -{ - [Parameter] - public TValue? Value { get; set; } - - [Parameter] - public EventCallback ValueChanged { get; set; } - - [Parameter] - public string HtmlInputMode { get; set; } = "text"; - - [Parameter] - public string Label { get; set; } = string.Empty; - - [Parameter] - public string? Units { get; set; } - - private void UpdateValue(ChangeEventArgs e) - { - try - { - Value = (TValue?)Convert.ChangeType(e.Value, typeof(TValue)); - } - catch (Exception) - { - Value = default; - } - - ValueChanged.InvokeAsync(Value); - } -} \ No newline at end of file diff --git a/AutoCut.Frontend/Pages/Index/Components/Input.razor.css b/AutoCut.Frontend/Pages/Index/Components/Input.razor.css deleted file mode 100644 index 1ffa5ef..0000000 --- a/AutoCut.Frontend/Pages/Index/Components/Input.razor.css +++ /dev/null @@ -1,39 +0,0 @@ -label { - display: flex; - flex-direction: column; - color: var(--text-gray); - font-size: 1rem; - gap: 5px; -} - -.input-wrapper { - display: flex; - background-color: var(--bright-background); - border: 1px solid var(--bright-border); - border-radius: 10px; - color: var(--text); - padding: 10px; - width: 6rem; - gap: 0.2rem; - align-items: center; -} - -.input-wrapper:focus-within { - border-color: var(--primary); -} - -input { - background: transparent; - border: none; - width: 100%; - color: white; -} - -input:focus { - outline: none; -} - -.units { - color: var(--text-gray); - flex-shrink: 0; -} diff --git a/AutoCut.Frontend/Pages/Index/Components/SvgVisualization.razor b/AutoCut.Frontend/Pages/Index/Components/SvgVisualization.razor deleted file mode 100644 index b16c6b5..0000000 --- a/AutoCut.Frontend/Pages/Index/Components/SvgVisualization.razor +++ /dev/null @@ -1,20 +0,0 @@ -@using AutoCut.Core.Models - - @foreach (var panel in Sheet.Panels) - { - - } - - -@code -{ - [Parameter] - [EditorRequired] - public OptimizedSheet Sheet { get; set; } = null!; - - private string SvgViewBox => $"0 0 {Sheet.Sheet.Length} {Sheet.Sheet.Width}"; -} \ No newline at end of file diff --git a/AutoCut.Frontend/Pages/Index/Components/SvgVisualization.razor.css b/AutoCut.Frontend/Pages/Index/Components/SvgVisualization.razor.css deleted file mode 100644 index 33696fc..0000000 --- a/AutoCut.Frontend/Pages/Index/Components/SvgVisualization.razor.css +++ /dev/null @@ -1,11 +0,0 @@ -svg { - background-color: var(--bright-background); - border: 1px solid var(--bright-border); -} - -rect { - fill: var(--primary); - fill-opacity: 0.1; - stroke: var(--primary); - stroke-width: 4px; -} diff --git a/AutoCut.Frontend/Pages/Index/Components/Tables.razor b/AutoCut.Frontend/Pages/Index/Components/Tables.razor deleted file mode 100644 index ae38bd0..0000000 --- a/AutoCut.Frontend/Pages/Index/Components/Tables.razor +++ /dev/null @@ -1,37 +0,0 @@ -
-
- - -
-
- @if (_showPanels) - { - - } - else if (_showCuts) - { - - } -
- -@code -{ - private bool _showPanels = true; - private bool _showCuts = false; - - private void ShowPanels() - { - _showPanels = true; - _showCuts = false; - } - - private void ShowCuts() - { - _showPanels = false; - _showCuts = true; - } -} \ No newline at end of file diff --git a/AutoCut.Frontend/Pages/Index/Components/Tables.razor.css b/AutoCut.Frontend/Pages/Index/Components/Tables.razor.css deleted file mode 100644 index ca8c762..0000000 --- a/AutoCut.Frontend/Pages/Index/Components/Tables.razor.css +++ /dev/null @@ -1,38 +0,0 @@ -section { - grid-area: tables; - background-color: var(--card-background); - border-radius: 10px; - border: 1px solid var(--card-border); - padding: 15px; - - /* TODO: scroll only table */ - overflow-x: scroll; -} - -hr { - height: 1px; - border: none; - background-color: var(--text-gray); - margin: 15px 0; -} - -.buttons { - display: flex; - gap: 15px; - padding: 0 10px; -} - -button { - border: none; - background: none; - text-transform: none; - font-size: 1.5rem; - padding: 0; - color: var(--text-gray); - font-weight: normal; -} - -button.active { - color: var(--text); - font-weight: bold; -} diff --git a/AutoCut.Frontend/Pages/Index/Components/VisualizationList.razor b/AutoCut.Frontend/Pages/Index/Components/VisualizationList.razor deleted file mode 100644 index 7629a70..0000000 --- a/AutoCut.Frontend/Pages/Index/Components/VisualizationList.razor +++ /dev/null @@ -1,14 +0,0 @@ -@using AutoCut.Frontend.Stores.Optimization -@inherits FluxorComponent -@inject IState OptimizationState - -
-
    - @foreach (var sheet in OptimizationState.Value.OptimizedSheets) - { -
  • - -
  • - } -
-
\ No newline at end of file diff --git a/AutoCut.Frontend/Pages/Index/Components/VisualizationList.razor.css b/AutoCut.Frontend/Pages/Index/Components/VisualizationList.razor.css deleted file mode 100644 index 60cbdeb..0000000 --- a/AutoCut.Frontend/Pages/Index/Components/VisualizationList.razor.css +++ /dev/null @@ -1,24 +0,0 @@ -section { - grid-area: visualization-list; - background-color: var(--card-background); - border-radius: 10px; - border: 1px solid var(--card-border); - padding: 15px; - overflow-y: scroll; -} - -li { - list-style-type: none; - padding: 0; - margin: 0; - cursor: pointer; -} - -ul { - padding: 0; - margin: 0; -} - -::deep svg { - width: 100%; -} diff --git a/AutoCut.Frontend/Pages/Index/Index.razor b/AutoCut.Frontend/Pages/Index/Index.razor deleted file mode 100644 index 6281e34..0000000 --- a/AutoCut.Frontend/Pages/Index/Index.razor +++ /dev/null @@ -1,10 +0,0 @@ -@page "/" -@using AutoCut.Frontend.Pages.Index.Components - -
- - - - - -
\ No newline at end of file diff --git a/AutoCut.Frontend/Pages/Index/Index.razor.css b/AutoCut.Frontend/Pages/Index/Index.razor.css deleted file mode 100644 index 74e04c0..0000000 --- a/AutoCut.Frontend/Pages/Index/Index.razor.css +++ /dev/null @@ -1,24 +0,0 @@ -main { - background-color: var(--background); - display: grid; - grid-template-columns: 3fr 7fr 3fr; - grid-template-rows: 100px 40px calc(100svh - 265px); - grid-template-areas: - "tables add-panel visualization-list" - "tables action-buttons visualization-list" - "tables current-visualization visualization-list"; - gap: 15px; - padding: 0 15px 15px; -} - -@media screen and (max-width: 600px) { - main { - grid-template-columns: 100%; - grid-template-rows: 100px 500px 40px auto; - grid-template-areas: - "add-panel" - "tables" - "action-buttons" - "visualization-list"; - } -} diff --git a/AutoCut.Frontend/Pages/Settings/Settings.razor b/AutoCut.Frontend/Pages/Settings/Settings.razor deleted file mode 100644 index 6e127d5..0000000 --- a/AutoCut.Frontend/Pages/Settings/Settings.razor +++ /dev/null @@ -1,70 +0,0 @@ -@page "/settings" -@using AutoCut.Core.Optimization -@using AutoCut.Core.Models -@using AutoCut.Frontend.Stores.Settings -@using AutoCut.Frontend.Stores.Settings.Actions -@inherits FluxorComponent -@inject IState SettingsState -@inject IStringLocalizer Localizer -@inject IDispatcher Dispatcher -@inject NavigationManager NavigationManager - -
-
-

@Localizer["Settings"]

- -

@Localizer["Sheet"]

- - - - - @* TODO: extract component for selecting edges and use it here *@ - -

@Localizer["Blade"]

- - -

@Localizer["Panels"]

- - - -
-
- -@code -{ - private OptimizerOptions OptimizerOptions { get; set; } = null!; - - private Sheet SheetTemplate { get; set; } = null!; - - protected override void OnInitialized() - { - OptimizerOptions = SettingsState.Value.OptimizerOptions; - SheetTemplate = SettingsState.Value.SheetTemplate; - - base.OnInitialized(); - } - - private void SaveSettings() - { - Dispatcher.Dispatch(new UpdateSettingsAction(OptimizerOptions, SheetTemplate)); - NavigationManager.NavigateTo(""); - } -} \ No newline at end of file diff --git a/AutoCut.Frontend/Pages/Settings/Settings.razor.css b/AutoCut.Frontend/Pages/Settings/Settings.razor.css deleted file mode 100644 index d77115f..0000000 --- a/AutoCut.Frontend/Pages/Settings/Settings.razor.css +++ /dev/null @@ -1,59 +0,0 @@ -main { - background-color: var(--background); - padding: 0 15px 15px; - color: var(--text); - height: calc(100vh - 80px); -} - -.card { - background-color: var(--card-background); - border-radius: 5px; - border: 1px solid var(--card-border); - padding: 15px; -} - -label { - display: block; - margin-top: 0.5rem; - color: var(--text-gray); -} - -input[type="number"] { - background-color: var(--bright-background); - border: 1px solid var(--bright-border); - border-radius: 10px; - color: var(--text); - width: 6rem; - padding: 0.2rem 0.5rem; -} - -input[type="number"]:focus { - outline: none; - border: 1px solid var(--primary); -} - -/* Chrome, Safari, Edge, Opera */ -input::-webkit-outer-spin-button, -input::-webkit-inner-spin-button { - -webkit-appearance: none; - margin: 0; -} - -/* Firefox */ -input[type="number"] { - -moz-appearance: textfield; -} - -h2 { - margin-top: 2rem; -} - -input[type="submit"] { - margin-top: 2rem; - background-color: var(--primary); - color: var(--text); -} - -input[type="submit"]:active { - transform: scale(0.95); -} diff --git a/AutoCut.Frontend/Program.cs b/AutoCut.Frontend/Program.cs deleted file mode 100644 index 060d665..0000000 --- a/AutoCut.Frontend/Program.cs +++ /dev/null @@ -1,21 +0,0 @@ -using AutoCut.Frontend; -using Fluxor; -using Microsoft.AspNetCore.Components.Web; -using Microsoft.AspNetCore.Components.WebAssembly.Hosting; - -var builder = WebAssemblyHostBuilder.CreateDefault(args); -builder.RootComponents.Add("#app"); -builder.RootComponents.Add("head::after"); - -builder.Services.AddScoped(sp => - new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); -builder.Services.AddFluxor(options => -{ - options.ScanAssemblies(typeof(Program).Assembly); -#if DEBUG - options.UseReduxDevTools(); -#endif -}); -builder.Services.AddLocalization(); - -await builder.Build().RunAsync(); \ No newline at end of file diff --git a/AutoCut.Frontend/Properties/launchSettings.json b/AutoCut.Frontend/Properties/launchSettings.json deleted file mode 100644 index 80c5c50..0000000 --- a/AutoCut.Frontend/Properties/launchSettings.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:44749", - "sslPort": 44354 - } - }, - "profiles": { - "http": { - "commandName": "Project", - "dotnetRunMessages": true, - "launchBrowser": true, - "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", - "applicationUrl": "http://localhost:5074", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "https": { - "commandName": "Project", - "dotnetRunMessages": true, - "launchBrowser": true, - "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", - "applicationUrl": "https://localhost:7027;http://localhost:5074", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - } - } -} diff --git a/AutoCut.Frontend/SharedComponents/AppBar.razor b/AutoCut.Frontend/SharedComponents/AppBar.razor deleted file mode 100644 index 8adc2e9..0000000 --- a/AutoCut.Frontend/SharedComponents/AppBar.razor +++ /dev/null @@ -1,70 +0,0 @@ -@using AutoCut.Frontend.Stores.Settings -@using AutoCut.Frontend.Stores.Optimization -@using System.Text.Json -@inherits FluxorComponent -@inject IDispatcher Dispatcher -@inject IJSRuntime JsRuntime -@inject IState SettingsState -@inject IState OptimizationState - -
- -
- -@code -{ - private async Task Export() - { - var exportData = new - { - Options = SettingsState.Value.OptimizerOptions, - SettingsState.Value.SheetTemplate, - Sheets = OptimizationState.Value.OptimizedSheets, - Cuts = Array.Empty() // placeholder, while cuts are not implemented - }; - - var options = new JsonSerializerOptions - { - WriteIndented = true - }; - - var json = JsonSerializer.SerializeToUtf8Bytes(exportData, options); - - using var streamReference = new DotNetStreamReference(new MemoryStream(json)); - - await JsRuntime.InvokeVoidAsync("downloadFileFromStream", "export.json", streamReference); - } -} \ No newline at end of file diff --git a/AutoCut.Frontend/SharedComponents/AppBar.razor.css b/AutoCut.Frontend/SharedComponents/AppBar.razor.css deleted file mode 100644 index c2ea3f9..0000000 --- a/AutoCut.Frontend/SharedComponents/AppBar.razor.css +++ /dev/null @@ -1,62 +0,0 @@ -nav { - display: flex; - justify-content: space-between; - align-items: center; - background-color: var(--background); - height: 80px; - padding: 0 20px; -} - -.logo { - font-size: 50px; -} - -.logo .normal { - font-family: Inter, sans-serif; - font-weight: 900; - color: var(--text); -} - -.logo .fancy { - font-family: "Permanent Marker", sans-serif; - font-weight: 400; - color: var(--primary); -} - -.buttons { - display: flex; - align-items: center; - gap: 20px; -} - -.button { - display: inline-flex; - align-items: center; - justify-content: center; - background: none; - border: none; - padding: 0; -} - -.button svg { - height: 30px; - color: var(--text); -} - -.button.settings svg { - transition: transform 0.2s; -} - -.button svg:hover { - transform: scale(1.1); -} - -.button.settings svg:hover { - transform: rotate(90deg); -} - -/* remove a styling */ -a { - text-decoration: none; - color: inherit; -} diff --git a/AutoCut.Frontend/SharedComponents/Cuts.razor b/AutoCut.Frontend/SharedComponents/Cuts.razor deleted file mode 100644 index 154400a..0000000 --- a/AutoCut.Frontend/SharedComponents/Cuts.razor +++ /dev/null @@ -1 +0,0 @@ -

Cuts are not implemented yet

\ No newline at end of file diff --git a/AutoCut.Frontend/SharedComponents/EdgesIcon.razor b/AutoCut.Frontend/SharedComponents/EdgesIcon.razor deleted file mode 100644 index d72ec5a..0000000 --- a/AutoCut.Frontend/SharedComponents/EdgesIcon.razor +++ /dev/null @@ -1,82 +0,0 @@ -@using AutoCut.Core.Models - - - - - - - - - - - - - - - - - @if (Edges.EdgesAlongLenght is 1 or 2) - { - - - - } - - @if (Edges.EdgesAlongLenght == 2) - { - - - - } - - @if (Edges.EdgesAlongWidth is 1 or 2) - { - - - - } - - @if (Edges.EdgesAlongWidth == 2) - { - - - - } - - - -@code -{ - - [Parameter] - public EdgeReduction Edges { get; set; } = EdgeReduction.NoEdges; - - [Parameter] - public EdgesIconAccent Accent { get; set; } = EdgesIconAccent.None; - - [Parameter] - public bool MutedColor { get; set; } - - public enum EdgesIconAccent - { - None, - Border, - All - } - - private string GetSvgClass() - { - var svgClass = Accent switch - { - EdgesIconAccent.None => "no-accent", - EdgesIconAccent.Border => "border-accent", - EdgesIconAccent.All => "all-accent", - _ => throw new ArgumentOutOfRangeException() - }; - - if (MutedColor) - svgClass += " muted"; - - return svgClass; - } -} \ No newline at end of file diff --git a/AutoCut.Frontend/SharedComponents/EdgesIcon.razor.css b/AutoCut.Frontend/SharedComponents/EdgesIcon.razor.css deleted file mode 100644 index 27b131c..0000000 --- a/AutoCut.Frontend/SharedComponents/EdgesIcon.razor.css +++ /dev/null @@ -1,23 +0,0 @@ -svg.no-accent { - fill: var(--text); -} - -svg.no-accent.muted { - fill: var(--text-gray); -} - -svg.border-accent g.base { - fill: var(--text); -} - -svg.border-accent g.base.muted { - fill: var(--text-gray); -} - -svg.border-accent g.border { - fill: var(--primary); -} - -svg.all-accent { - fill: var(--primary); -} diff --git a/AutoCut.Frontend/SharedComponents/Panels.razor b/AutoCut.Frontend/SharedComponents/Panels.razor deleted file mode 100644 index 1685b40..0000000 --- a/AutoCut.Frontend/SharedComponents/Panels.razor +++ /dev/null @@ -1,43 +0,0 @@ -@using AutoCut.Frontend.Stores.Panels -@inherits FluxorComponent -@inject IState PanelsState - -@if (PanelsState.Value.Panels.Count > 0) -{ - - - - - - - - - - - - @foreach (var panel in PanelsState.Value.Panels) - { - - - - - - - - - } - -
@Localizer["Length"]@Localizer["Width"]@Localizer["Quantity"]@Localizer["Name"]@Localizer["EdgeBanding"]
@panel.Panel.Length@panel.Panel.Width@panel.Quantity@panel.Panel.Name - - - -
-} -else -{ -

@Localizer["NoPanelsInfo"]

-} \ No newline at end of file diff --git a/AutoCut.Frontend/SharedComponents/Panels.razor.css b/AutoCut.Frontend/SharedComponents/Panels.razor.css deleted file mode 100644 index 2aa9919..0000000 --- a/AutoCut.Frontend/SharedComponents/Panels.razor.css +++ /dev/null @@ -1,52 +0,0 @@ -.scroll { - overflow-y: scroll; -} - -table { - width: 100%; - border-spacing: 0 15px; - margin-top: -15px; - padding: 0 10px; -} - -table * { - text-align: start; - border: none; -} - -thead { - color: var(--text-gray); - font-size: 0.9rem; -} - -tbody { - color: var(--text); - font-size: 1.2rem; -} - -.delete-button svg { - stroke: var(--error); -} - -.delete-button:active svg { - transform: scale(0.95); -} - -.delete-button { - border: none; - background: none; - text-transform: none; - padding: 0; -} - -::deep svg { - width: 1.2rem; - height: 1.2rem; -} - -.no-panels-info { - color: var(--text-gray); - font-size: 1rem; - text-align: center; - padding: 0 15px; -} diff --git a/AutoCut.Frontend/Stores/Optimization/Actions/OptimizeAction.cs b/AutoCut.Frontend/Stores/Optimization/Actions/OptimizeAction.cs deleted file mode 100644 index df5dea4..0000000 --- a/AutoCut.Frontend/Stores/Optimization/Actions/OptimizeAction.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace AutoCut.Frontend.Stores.Optimization.Actions; - -public class OptimizeAction -{ -} \ No newline at end of file diff --git a/AutoCut.Frontend/Stores/Optimization/Actions/SetOptimizedPanelsAction.cs b/AutoCut.Frontend/Stores/Optimization/Actions/SetOptimizedPanelsAction.cs deleted file mode 100644 index a201ddc..0000000 --- a/AutoCut.Frontend/Stores/Optimization/Actions/SetOptimizedPanelsAction.cs +++ /dev/null @@ -1,13 +0,0 @@ -using AutoCut.Core.Models; - -namespace AutoCut.Frontend.Stores.Optimization.Actions; - -public class SetOptimizedPanelsAction -{ - public SetOptimizedPanelsAction(List optimizedSheets) - { - OptimizedSheets = optimizedSheets; - } - - public List OptimizedSheets { get; } -} \ No newline at end of file diff --git a/AutoCut.Frontend/Stores/Optimization/OptimizationEffects.cs b/AutoCut.Frontend/Stores/Optimization/OptimizationEffects.cs deleted file mode 100644 index 17c58d2..0000000 --- a/AutoCut.Frontend/Stores/Optimization/OptimizationEffects.cs +++ /dev/null @@ -1,29 +0,0 @@ -using AutoCut.Core.Models; -using AutoCut.Core.Optimization; -using AutoCut.Frontend.Stores.Optimization.Actions; -using AutoCut.Frontend.Stores.Panels; -using Fluxor; - -namespace AutoCut.Frontend.Stores.Optimization; - -public class OptimizationEffects -{ - private readonly IState _panelsState; - - public OptimizationEffects(IState panelsState) - { - _panelsState = panelsState; - } - - [EffectMethod(typeof(OptimizeAction))] - public Task OptimizeAction(IDispatcher dispatcher) - { - // TODO: make optimizer async - - var optimizer = new Optimizer(); - var panels = _panelsState.Value.Panels; - var result = optimizer.Optimize(Sheet.Default, panels, new OptimizerOptions()); - dispatcher.Dispatch(new SetOptimizedPanelsAction(result.OptimizedSheets)); - return Task.CompletedTask; - } -} \ No newline at end of file diff --git a/AutoCut.Frontend/Stores/Optimization/OptimizationFeature.cs b/AutoCut.Frontend/Stores/Optimization/OptimizationFeature.cs deleted file mode 100644 index 597d4ca..0000000 --- a/AutoCut.Frontend/Stores/Optimization/OptimizationFeature.cs +++ /dev/null @@ -1,14 +0,0 @@ -using AutoCut.Core.Models; -using Fluxor; - -namespace AutoCut.Frontend.Stores.Optimization; - -public class OptimizationFeature : Feature -{ - public override string GetName() => "Optimization"; - - protected override OptimizationState GetInitialState() - { - return new OptimizationState { OptimizedSheets = new List() }; - } -} \ No newline at end of file diff --git a/AutoCut.Frontend/Stores/Optimization/OptimizationReducers.cs b/AutoCut.Frontend/Stores/Optimization/OptimizationReducers.cs deleted file mode 100644 index cad7d48..0000000 --- a/AutoCut.Frontend/Stores/Optimization/OptimizationReducers.cs +++ /dev/null @@ -1,13 +0,0 @@ -using AutoCut.Frontend.Stores.Optimization.Actions; -using Fluxor; - -namespace AutoCut.Frontend.Stores.Optimization; - -public static class OptimizationReducers -{ - [ReducerMethod] - public static OptimizationState SetOptimizedPanelsAction(OptimizationState state, SetOptimizedPanelsAction action) - { - return state with { OptimizedSheets = action.OptimizedSheets }; - } -} \ No newline at end of file diff --git a/AutoCut.Frontend/Stores/Optimization/OptimizationState.cs b/AutoCut.Frontend/Stores/Optimization/OptimizationState.cs deleted file mode 100644 index 8e7df5f..0000000 --- a/AutoCut.Frontend/Stores/Optimization/OptimizationState.cs +++ /dev/null @@ -1,8 +0,0 @@ -using AutoCut.Core.Models; - -namespace AutoCut.Frontend.Stores.Optimization; - -public record OptimizationState -{ - public List OptimizedSheets { get; init; } = new(); -} \ No newline at end of file diff --git a/AutoCut.Frontend/Stores/Panels/Actions/AddAction.cs b/AutoCut.Frontend/Stores/Panels/Actions/AddAction.cs deleted file mode 100644 index 66b95d7..0000000 --- a/AutoCut.Frontend/Stores/Panels/Actions/AddAction.cs +++ /dev/null @@ -1,13 +0,0 @@ -using AutoCut.Core.Models; - -namespace AutoCut.Frontend.Stores.Panels.Actions; - -public class AddAction -{ - public AddAction(CompressedPanel panel) - { - Panel = panel; - } - - public CompressedPanel Panel { get; } -} \ No newline at end of file diff --git a/AutoCut.Frontend/Stores/Panels/Actions/ResetAction.cs b/AutoCut.Frontend/Stores/Panels/Actions/ResetAction.cs deleted file mode 100644 index fb493b1..0000000 --- a/AutoCut.Frontend/Stores/Panels/Actions/ResetAction.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace AutoCut.Frontend.Stores.Panels.Actions; - -public class ResetAction -{ -} \ No newline at end of file diff --git a/AutoCut.Frontend/Stores/Panels/PanelEffects.cs b/AutoCut.Frontend/Stores/Panels/PanelEffects.cs deleted file mode 100644 index a0808ea..0000000 --- a/AutoCut.Frontend/Stores/Panels/PanelEffects.cs +++ /dev/null @@ -1,15 +0,0 @@ -using AutoCut.Frontend.Stores.Optimization.Actions; -using AutoCut.Frontend.Stores.Panels.Actions; -using Fluxor; - -namespace AutoCut.Frontend.Stores.Panels; - -public class PanelEffects -{ - [EffectMethod(typeof(ResetAction))] - public Task ResetAction(IDispatcher dispatcher) - { - dispatcher.Dispatch(new OptimizeAction()); - return Task.CompletedTask; - } -} \ No newline at end of file diff --git a/AutoCut.Frontend/Stores/Panels/PanelsFeature.cs b/AutoCut.Frontend/Stores/Panels/PanelsFeature.cs deleted file mode 100644 index 7a14014..0000000 --- a/AutoCut.Frontend/Stores/Panels/PanelsFeature.cs +++ /dev/null @@ -1,14 +0,0 @@ -using AutoCut.Core.Models; -using Fluxor; - -namespace AutoCut.Frontend.Stores.Panels; - -public class PanelsFeature : Feature -{ - public override string GetName() => "Panels"; - - protected override PanelsState GetInitialState() - { - return new PanelsState { Panels = new List() }; - } -} \ No newline at end of file diff --git a/AutoCut.Frontend/Stores/Panels/PanelsReducers.cs b/AutoCut.Frontend/Stores/Panels/PanelsReducers.cs deleted file mode 100644 index c61b270..0000000 --- a/AutoCut.Frontend/Stores/Panels/PanelsReducers.cs +++ /dev/null @@ -1,22 +0,0 @@ -using AutoCut.Core.Models; -using AutoCut.Frontend.Stores.Panels.Actions; -using Fluxor; - -namespace AutoCut.Frontend.Stores.Panels; - -public static class PanelsReducers -{ - [ReducerMethod(typeof(ResetAction))] - public static PanelsState PanelResetAction(PanelsState state) - { - return state with { Panels = new List() }; - } - - [ReducerMethod] - public static PanelsState PanelAddAction(PanelsState state, AddAction action) - { - var panels = state.Panels; - panels.Add(action.Panel); - return state with { Panels = panels }; - } -} \ No newline at end of file diff --git a/AutoCut.Frontend/Stores/Panels/PanelsState.cs b/AutoCut.Frontend/Stores/Panels/PanelsState.cs deleted file mode 100644 index d01c21f..0000000 --- a/AutoCut.Frontend/Stores/Panels/PanelsState.cs +++ /dev/null @@ -1,8 +0,0 @@ -using AutoCut.Core.Models; - -namespace AutoCut.Frontend.Stores.Panels; - -public record PanelsState -{ - public List Panels { get; init; } = new(); -} \ No newline at end of file diff --git a/AutoCut.Frontend/Stores/Settings/Actions/UpdateSettingsAction.cs b/AutoCut.Frontend/Stores/Settings/Actions/UpdateSettingsAction.cs deleted file mode 100644 index d229615..0000000 --- a/AutoCut.Frontend/Stores/Settings/Actions/UpdateSettingsAction.cs +++ /dev/null @@ -1,17 +0,0 @@ -using AutoCut.Core.Models; -using AutoCut.Core.Optimization; - -namespace AutoCut.Frontend.Stores.Settings.Actions; - -public class UpdateSettingsAction -{ - public UpdateSettingsAction(OptimizerOptions optimizerOptions, Sheet sheetTemplate) - { - OptimizerOptions = optimizerOptions; - SheetTemplate = sheetTemplate; - } - - public OptimizerOptions OptimizerOptions { get; } - - public Sheet SheetTemplate { get; } -} \ No newline at end of file diff --git a/AutoCut.Frontend/Stores/Settings/SettingsFeature.cs b/AutoCut.Frontend/Stores/Settings/SettingsFeature.cs deleted file mode 100644 index 98a8b55..0000000 --- a/AutoCut.Frontend/Stores/Settings/SettingsFeature.cs +++ /dev/null @@ -1,24 +0,0 @@ -using AutoCut.Core.Models; -using AutoCut.Core.Optimization; -using Fluxor; - -namespace AutoCut.Frontend.Stores.Settings; - -public class SettingsFeature : Feature -{ - public override string GetName() => "Settings"; - - protected override SettingsState GetInitialState() - { - var options = new OptimizerOptions - { - BladeThickness = 3 - }; - - return new SettingsState - { - OptimizerOptions = options, - SheetTemplate = Sheet.Default - }; - } -} \ No newline at end of file diff --git a/AutoCut.Frontend/Stores/Settings/SettingsReducers.cs b/AutoCut.Frontend/Stores/Settings/SettingsReducers.cs deleted file mode 100644 index 734d883..0000000 --- a/AutoCut.Frontend/Stores/Settings/SettingsReducers.cs +++ /dev/null @@ -1,11 +0,0 @@ -using AutoCut.Frontend.Stores.Settings.Actions; -using Fluxor; - -namespace AutoCut.Frontend.Stores.Settings; - -public static class SettingsReducers -{ - [ReducerMethod] - public static SettingsState UpdateSettingsAction(SettingsState state, UpdateSettingsAction action) => - new() { OptimizerOptions = action.OptimizerOptions, SheetTemplate = action.SheetTemplate }; -} \ No newline at end of file diff --git a/AutoCut.Frontend/Stores/Settings/SettingsState.cs b/AutoCut.Frontend/Stores/Settings/SettingsState.cs deleted file mode 100644 index 1cab24c..0000000 --- a/AutoCut.Frontend/Stores/Settings/SettingsState.cs +++ /dev/null @@ -1,11 +0,0 @@ -using AutoCut.Core.Models; -using AutoCut.Core.Optimization; - -namespace AutoCut.Frontend.Stores.Settings; - -public record SettingsState -{ - public required OptimizerOptions OptimizerOptions { get; init; } - - public required Sheet SheetTemplate { get; init; } -} \ No newline at end of file diff --git a/AutoCut.Frontend/_Imports.razor b/AutoCut.Frontend/_Imports.razor deleted file mode 100644 index d3cfef3..0000000 --- a/AutoCut.Frontend/_Imports.razor +++ /dev/null @@ -1,21 +0,0 @@ -@using System.Net.Http -@using System.Net.Http.Json - -@using Microsoft.AspNetCore.Components.Forms -@using Microsoft.AspNetCore.Components.Routing -@using Microsoft.AspNetCore.Components.Web -@using Microsoft.AspNetCore.Components.Web.Virtualization -@using Microsoft.AspNetCore.Components.WebAssembly.Http -@using Microsoft.JSInterop -@using Microsoft.Extensions.Localization - -@using AutoCut.Frontend -@using AutoCut.Frontend.Layouts -@using AutoCut.Frontend.Stores -@using AutoCut.Frontend.Localization -@using AutoCut.Frontend.SharedComponents - -@using Fluxor -@using Fluxor.Blazor.Web.Components - -@inject IStringLocalizer Localizer \ No newline at end of file diff --git a/AutoCut.Frontend/wwwroot/app.js b/AutoCut.Frontend/wwwroot/app.js deleted file mode 100644 index b34c7a6..0000000 --- a/AutoCut.Frontend/wwwroot/app.js +++ /dev/null @@ -1,11 +0,0 @@ -window.downloadFileFromStream = async (fileName, contentStreamReference) => { - const arrayBuffer = await contentStreamReference.arrayBuffer(); - const blob = new Blob([arrayBuffer]); - const url = URL.createObjectURL(blob); - const anchorElement = document.createElement("a"); - anchorElement.href = url; - anchorElement.download = fileName ?? ""; - anchorElement.click(); - anchorElement.remove(); - URL.revokeObjectURL(url); -}; diff --git a/AutoCut.Frontend/wwwroot/css/app.css b/AutoCut.Frontend/wwwroot/css/app.css deleted file mode 100644 index 656a33a..0000000 --- a/AutoCut.Frontend/wwwroot/css/app.css +++ /dev/null @@ -1,114 +0,0 @@ -@import url("https://fonts.googleapis.com/css2?family=Permanent+Marker&family=Inter:wght@400;700;900&display=swap"); - -body { - font-family: "Inter", sans-serif; - margin: 0; - padding: 0; -} - -button, -input[type="button"], -input[type="submit"], -input[type="reset"] { - text-align: center; - text-transform: uppercase; - font-weight: bold; - border-radius: 5px; - border: none; - padding: 10px 20px; - cursor: pointer; -} - -h1, -h2, -h3, -h4, -h5, -h6 { - margin: 0; -} - -#app { - height: 100%; -} - -*, -*::before, -*::after { - box-sizing: border-box; -} - -/* default blazor things */ - -#blazor-error-ui { - background: lightyellow; - bottom: 0; - box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); - display: none; - left: 0; - padding: 0.6rem 1.25rem 0.7rem 1.25rem; - position: fixed; - width: 100%; - z-index: 1000; -} - -#blazor-error-ui .dismiss { - cursor: pointer; - position: absolute; - right: 0.75rem; - top: 0.5rem; -} - -.blazor-error-boundary { - background: - url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) - no-repeat 1rem/1.8rem, - #b32121; - padding: 1rem 1rem 1rem 3.7rem; - color: white; -} - -.blazor-error-boundary::after { - content: "An error has occurred."; -} - -.loading-progress { - position: relative; - display: block; - width: 8rem; - height: 8rem; - margin: 20vh auto 1rem auto; -} - -.loading-progress circle { - fill: none; - stroke: #e0e0e0; - stroke-width: 0.6rem; - transform-origin: 50% 50%; - transform: rotate(-90deg); -} - -.loading-progress circle:last-child { - stroke: #a3e635; /* our primary color */ - /*noinspection CssUnresolvedCustomProperty*/ - stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%; - transition: stroke-dasharray 0.05s ease-in-out; -} - -.loading-progress-text { - position: absolute; - text-align: center; - font-weight: bold; - inset: calc(20vh + 3.25rem) 0 auto 0.2rem; -} - -.loading-progress-text:after { - /*noinspection CssUnresolvedCustomProperty*/ - content: var(--blazor-load-percentage-text, "Loading"); - font-family: sans-serif; -} - -/* for visualization TODO: remove after switching to svg */ -canvas { - position: absolute; -} diff --git a/AutoCut.Frontend/wwwroot/css/normalize.css b/AutoCut.Frontend/wwwroot/css/normalize.css deleted file mode 100644 index a7dbd3e..0000000 --- a/AutoCut.Frontend/wwwroot/css/normalize.css +++ /dev/null @@ -1,351 +0,0 @@ -/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */ - -/* Document - ========================================================================== */ - -/** - * 1. Correct the line height in all browsers. - * 2. Prevent adjustments of font size after orientation changes in iOS. - */ - -html { - line-height: 1.15; /* 1 */ - -webkit-text-size-adjust: 100%; /* 2 */ -} - -/* Sections - ========================================================================== */ - -/** - * Remove the margin in all browsers. - */ - -body { - margin: 0; -} - -/** - * Render the `main` element consistently in IE. - */ - -main { - display: block; -} - -/** - * Correct the font size and margin on `h1` elements within `section` and - * `article` contexts in Chrome, Firefox, and Safari. - */ - -h1 { - font-size: 2em; - margin: 0.67em 0; -} - -/* Grouping content - ========================================================================== */ - -/** - * 1. Add the correct box sizing in Firefox. - * 2. Show the overflow in Edge and IE. - */ - -hr { - box-sizing: content-box; /* 1 */ - height: 0; /* 1 */ - overflow: visible; /* 2 */ -} - -/** - * 1. Correct the inheritance and scaling of font size in all browsers. - * 2. Correct the odd `em` font sizing in all browsers. - */ - -pre { - font-family: monospace, monospace; /* 1 */ - font-size: 1em; /* 2 */ -} - -/* Text-level semantics - ========================================================================== */ - -/** - * Remove the gray background on active links in IE 10. - */ - -a { - background-color: transparent; -} - -/** - * 1. Remove the bottom border in Chrome 57- - * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. - */ - -abbr[title] { - border-bottom: none; /* 1 */ - text-decoration: underline; /* 2 */ - text-decoration: underline dotted; /* 2 */ -} - -/** - * Add the correct font weight in Chrome, Edge, and Safari. - */ - -b, -strong { - font-weight: bolder; -} - -/** - * 1. Correct the inheritance and scaling of font size in all browsers. - * 2. Correct the odd `em` font sizing in all browsers. - */ - -code, -kbd, -samp { - font-family: monospace, monospace; /* 1 */ - font-size: 1em; /* 2 */ -} - -/** - * Add the correct font size in all browsers. - */ - -small { - font-size: 80%; -} - -/** - * Prevent `sub` and `sup` elements from affecting the line height in - * all browsers. - */ - -sub, -sup { - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline; -} - -sub { - bottom: -0.25em; -} - -sup { - top: -0.5em; -} - -/* Embedded content - ========================================================================== */ - -/** - * Remove the border on images inside links in IE 10. - */ - -img { - border-style: none; -} - -/* Forms - ========================================================================== */ - -/** - * 1. Change the font styles in all browsers. - * 2. Remove the margin in Firefox and Safari. - */ - -button, -input, -optgroup, -select, -textarea { - font-family: inherit; /* 1 */ - font-size: 100%; /* 1 */ - line-height: 1.15; /* 1 */ - margin: 0; /* 2 */ -} - -/** - * Show the overflow in IE. - * 1. Show the overflow in Edge. - */ - -button, -input { - /* 1 */ - overflow: visible; -} - -/** - * Remove the inheritance of text transform in Edge, Firefox, and IE. - * 1. Remove the inheritance of text transform in Firefox. - */ - -button, -select { - /* 1 */ - text-transform: none; -} - -/** - * Correct the inability to style clickable types in iOS and Safari. - */ - -button, -[type="button"], -[type="reset"], -[type="submit"] { - -webkit-appearance: button; -} - -/** - * Remove the inner border and padding in Firefox. - */ - -button::-moz-focus-inner, -[type="button"]::-moz-focus-inner, -[type="reset"]::-moz-focus-inner, -[type="submit"]::-moz-focus-inner { - border-style: none; - padding: 0; -} - -/** - * Restore the focus styles unset by the previous rule. - */ - -button:-moz-focusring, -[type="button"]:-moz-focusring, -[type="reset"]:-moz-focusring, -[type="submit"]:-moz-focusring { - outline: 1px dotted ButtonText; -} - -/** - * Correct the padding in Firefox. - */ - -fieldset { - padding: 0.35em 0.75em 0.625em; -} - -/** - * 1. Correct the text wrapping in Edge and IE. - * 2. Correct the color inheritance from `fieldset` elements in IE. - * 3. Remove the padding so developers are not caught out when they zero out - * `fieldset` elements in all browsers. - */ - -legend { - box-sizing: border-box; /* 1 */ - color: inherit; /* 2 */ - display: table; /* 1 */ - max-width: 100%; /* 1 */ - padding: 0; /* 3 */ - white-space: normal; /* 1 */ -} - -/** - * Add the correct vertical alignment in Chrome, Firefox, and Opera. - */ - -progress { - vertical-align: baseline; -} - -/** - * Remove the default vertical scrollbar in IE 10+. - */ - -textarea { - overflow: auto; -} - -/** - * 1. Add the correct box sizing in IE 10. - * 2. Remove the padding in IE 10. - */ - -[type="checkbox"], -[type="radio"] { - box-sizing: border-box; /* 1 */ - padding: 0; /* 2 */ -} - -/** - * Correct the cursor style of increment and decrement buttons in Chrome. - */ - -[type="number"]::-webkit-inner-spin-button, -[type="number"]::-webkit-outer-spin-button { - height: auto; -} - -/** - * 1. Correct the odd appearance in Chrome and Safari. - * 2. Correct the outline style in Safari. - */ - -[type="search"] { - -webkit-appearance: textfield; /* 1 */ - outline-offset: -2px; /* 2 */ -} - -/** - * Remove the inner padding in Chrome and Safari on macOS. - */ - -[type="search"]::-webkit-search-decoration { - -webkit-appearance: none; -} - -/** - * 1. Correct the inability to style clickable types in iOS and Safari. - * 2. Change font properties to `inherit` in Safari. - */ - -::-webkit-file-upload-button { - -webkit-appearance: button; /* 1 */ - font: inherit; /* 2 */ -} - -/* Interactive - ========================================================================== */ - -/* - * Add the correct display in Edge, IE 10+, and Firefox. - */ - -details { - display: block; -} - -/* - * Add the correct display in all browsers. - */ - -summary { - display: list-item; -} - -/* Misc - ========================================================================== */ - -/** - * Add the correct display in IE 10+. - */ - -template { - display: none; -} - -/** - * Add the correct display in IE 10. - */ - -[hidden] { - display: none; -} diff --git a/AutoCut.Frontend/wwwroot/favicon.png b/AutoCut.Frontend/wwwroot/favicon.png deleted file mode 100644 index 7fb6b47..0000000 Binary files a/AutoCut.Frontend/wwwroot/favicon.png and /dev/null differ diff --git a/AutoCut.Frontend/wwwroot/index.html b/AutoCut.Frontend/wwwroot/index.html deleted file mode 100644 index 84a3e86..0000000 --- a/AutoCut.Frontend/wwwroot/index.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - AutoCut - - - - - - - - - - - - - - - - - -
- - - - -
-
- -
- An unhandled error has occurred. - Reload - 🗙 -
- - - - - diff --git a/AutoCut.Frontend/wwwroot/manifest.json b/AutoCut.Frontend/wwwroot/manifest.json deleted file mode 100644 index 96768f0..0000000 --- a/AutoCut.Frontend/wwwroot/manifest.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "AutoCut", - "short_name": "AutoCut", - "start_url": "./", - "display": "fullscreen", - "categories": ["productivity", "tools", "utilities"], - "description": "Panel cutting optimization software running on WASM in your browser", - "background_color": "#ffffff", - "theme_color": "#03173d", - "prefer_related_applications": false, - "icons": [ - { - "src": "favicon.png", - "type": "image/png", - "sizes": "256x256" - } - ] -} diff --git a/AutoCut.Frontend/wwwroot/service-worker.js b/AutoCut.Frontend/wwwroot/service-worker.js deleted file mode 100644 index e9ddd26..0000000 --- a/AutoCut.Frontend/wwwroot/service-worker.js +++ /dev/null @@ -1,4 +0,0 @@ -// In development, always fetch from the network and do not enable offline support. -// This is because caching would make development more difficult (changes would not -// be reflected on the first load after each change). -self.addEventListener("fetch", () => {}); diff --git a/AutoCut.Frontend/wwwroot/service-worker.published.js b/AutoCut.Frontend/wwwroot/service-worker.published.js deleted file mode 100644 index 9ceb811..0000000 --- a/AutoCut.Frontend/wwwroot/service-worker.published.js +++ /dev/null @@ -1,76 +0,0 @@ -// Caution! Be sure you understand the caveats before publishing an application with -// offline support. See https://aka.ms/blazor-offline-considerations - -self.importScripts("./service-worker-assets.js"); -self.addEventListener("install", (event) => event.waitUntil(onInstall(event))); -self.addEventListener("activate", (event) => - event.waitUntil(onActivate(event)), -); -self.addEventListener("fetch", (event) => event.respondWith(onFetch(event))); - -const cacheNamePrefix = "offline-cache-"; -const cacheName = `${cacheNamePrefix}${self.assetsManifest.version}`; -const offlineAssetsInclude = [ - /\.dll$/, - /\.pdb$/, - /\.wasm/, - /\.html/, - /\.js$/, - /\.json$/, - /\.css$/, - /\.woff$/, - /\.png$/, - /\.jpe?g$/, - /\.gif$/, - /\.ico$/, - /\.blat$/, - /\.dat$/, - /\.br$/, -]; -const offlineAssetsExclude = [/^service-worker\.js$/]; - -async function onInstall(event) { - console.info("Service worker: Install"); - - // Fetch and cache all matching items from the assets manifest - const assetsRequests = self.assetsManifest.assets - .filter((asset) => - offlineAssetsInclude.some((pattern) => pattern.test(asset.url)), - ) - .filter( - (asset) => - !offlineAssetsExclude.some((pattern) => pattern.test(asset.url)), - ) - .map( - (asset) => - new Request(asset.url, { integrity: asset.hash, cache: "no-cache" }), - ); - await caches.open(cacheName).then((cache) => cache.addAll(assetsRequests)); -} - -async function onActivate(event) { - console.info("Service worker: Activate"); - - // Delete unused caches - const cacheKeys = await caches.keys(); - await Promise.all( - cacheKeys - .filter((key) => key.startsWith(cacheNamePrefix) && key !== cacheName) - .map((key) => caches.delete(key)), - ); -} - -async function onFetch(event) { - let cachedResponse = null; - if (event.request.method === "GET") { - // For all navigation requests, try to serve index.html from cache - // If you need some URLs to be server-rendered, edit the following check to exclude those URLs - const shouldServeIndexHtml = event.request.mode === "navigate"; - - const request = shouldServeIndexHtml ? "index.html" : event.request; - const cache = await caches.open(cacheName); - cachedResponse = await cache.match(request); - } - - return cachedResponse || fetch(event.request); -} diff --git a/AutoCut.sln.DotSettings b/AutoCut.sln.DotSettings deleted file mode 100644 index efc8d9a..0000000 --- a/AutoCut.sln.DotSettings +++ /dev/null @@ -1,2 +0,0 @@ - - True \ No newline at end of file diff --git a/AutoCut.sln.DotSettings.user b/AutoCut.sln.DotSettings.user deleted file mode 100644 index 53426d8..0000000 --- a/AutoCut.sln.DotSettings.user +++ /dev/null @@ -1,22 +0,0 @@ - - - - <SessionState ContinuousTestingMode="0" Name="PanelUtilitiesTests" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"> - <TestAncestor> - <TestId>xUnit::69DF46F1-6E03-4187-A67E-9662438C9722::net7.0::AutoCut.Core.UnitTests.Models.Panels.PanelUtilitiesTests</TestId> - <TestId>xUnit::69DF46F1-6E03-4187-A67E-9662438C9722::net7.0::AutoCut.Core.UnitTests.Optimization.OptimizerTests.SinglePanel</TestId> - <TestId>xUnit::69DF46F1-6E03-4187-A67E-9662438C9722::net7.0::AutoCut.Core.UnitTests.Optimization.OptimizerTests</TestId> - </TestAncestor> -</SessionState> - <SessionState ContinuousTestingMode="0" IsActive="True" Name="PanelUtilitiesTests #2" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"> - <TestAncestor> - <TestId>xUnit::69DF46F1-6E03-4187-A67E-9662438C9722::net7.0::AutoCut.Core.UnitTests.Models.Panels.PanelUtilitiesTests</TestId> - <TestId>xUnit::69DF46F1-6E03-4187-A67E-9662438C9722::net7.0::AutoCut.Core.UnitTests.Optimization.OptimizerTests.SinglePanel</TestId> - <TestId>xUnit::69DF46F1-6E03-4187-A67E-9662438C9722::net7.0::AutoCut.Core.UnitTests.Optimization.OptimizerTests</TestId> - </TestAncestor> -</SessionState> - True - - True - False - \ No newline at end of file