From 2b8e41b5279c2d3ab370595f6593b64ea734ef87 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Sun, 4 Mar 2018 15:28:15 +0200 Subject: Implemented job embroidery image capture, display export, Implemented running job text to speech. --- .../Views/EmbroideryDisplayView.xaml | 51 ++++++++++++++++++++++ .../Views/EmbroideryDisplayView.xaml.cs | 28 ++++++++++++ .../Views/EmbroideryImportView.xaml | 2 +- .../Views/EmbroideryImportView.xaml.cs | 9 ++++ .../Views/JobView.xaml | 4 +- .../Views/MachineJobSelectionView.xaml | 25 ++++++++++- .../Views/MainView.xaml | 4 +- 7 files changed, 116 insertions(+), 7 deletions(-) create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/EmbroideryDisplayView.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/EmbroideryDisplayView.xaml.cs (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/EmbroideryDisplayView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/EmbroideryDisplayView.xaml new file mode 100644 index 000000000..a753453f9 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/EmbroideryDisplayView.xaml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/EmbroideryDisplayView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/EmbroideryDisplayView.xaml.cs new file mode 100644 index 000000000..7d0771098 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/EmbroideryDisplayView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.MachineStudio.Developer.Views +{ + /// + /// Interaction logic for EmbroideryDisplayView.xaml + /// + public partial class EmbroideryDisplayView : UserControl + { + public EmbroideryDisplayView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/EmbroideryImportView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/EmbroideryImportView.xaml index 220e7d3ab..d084aabcf 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/EmbroideryImportView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/EmbroideryImportView.xaml @@ -47,7 +47,7 @@ - - diff --git a/Software/Visual_Studio/Tango.BL/ObservablesEntitiesAdapter.cs b/Software/Visual_Studio/Tango.BL/ObservablesEntitiesAdapter.cs index 8e898ac18..770931309 100644 --- a/Software/Visual_Studio/Tango.BL/ObservablesEntitiesAdapter.cs +++ b/Software/Visual_Studio/Tango.BL/ObservablesEntitiesAdapter.cs @@ -158,7 +158,7 @@ namespace Tango.BL foreach (var machine in Machines) { machine.MachinesConfigurations = machine.MachinesConfigurations.OrderByDescending(x => x.Configuration.CreationDate).Take(30).ToObservableCollection(); - machine.Jobs = machine.Jobs.OrderByDescending(x => x.CreationDate).ToObservableCollection(); + //machine.Jobs = machine.Jobs.OrderByDescending(x => x.CreationDate).ToObservableCollection(); //No need to load jobs. } MachinesConfigurations = Context.MachinesConfigurations.ToObservableCollection(); -- cgit v1.3.1 From 628819a1787290f84c22ecc7cb747f649fd54468 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Mon, 5 Mar 2018 12:34:58 +0200 Subject: Added dynamic factoring for embroidery import thread length. --- Software/DB/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/Tango_log.ldf | Bin 1048576 -> 1048576 bytes .../EmbroideryMaterialsHelper.cs | 23 +++++++++++ .../Tango.EmbroideryUI/IEmbroideryMaterial.cs | 15 +++++++ .../Tango.EmbroideryUI/Materials/Jersey.cs | 27 +++++++++++++ .../Tango.EmbroideryUI/Materials/Leather.cs | 27 +++++++++++++ .../Tango.EmbroideryUI/Materials/Linen.cs | 27 +++++++++++++ .../Tango.EmbroideryUI/Materials/Lycra.cs | 27 +++++++++++++ .../Tango.EmbroideryUI/Materials/Mesh.cs | 27 +++++++++++++ .../Tango.EmbroideryUI/Materials/MicroFiber.cs | 27 +++++++++++++ .../Tango.EmbroideryUI/Materials/Nylon.cs | 27 +++++++++++++ .../Tango.EmbroideryUI/Materials/Pique.cs | 27 +++++++++++++ .../Tango.EmbroideryUI/Materials/PolyCotton.cs | 27 +++++++++++++ .../Tango.EmbroideryUI/Materials/Polyester.cs | 27 +++++++++++++ .../Tango.EmbroideryUI/Materials/PureCotton.cs | 27 +++++++++++++ .../Tango.EmbroideryUI/Materials/Rayon.cs | 27 +++++++++++++ .../Tango.EmbroideryUI/Tango.EmbroideryUI.csproj | 14 +++++++ .../ViewModels/EmbroideryImportViewVM.cs | 43 ++++++++++++++++++--- .../ViewModels/MainViewVM.cs | 21 +++++++--- .../Views/EmbroideryImportView.xaml | 29 ++++++++++++-- 20 files changed, 456 insertions(+), 13 deletions(-) create mode 100644 Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/EmbroideryMaterialsHelper.cs create mode 100644 Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/IEmbroideryMaterial.cs create mode 100644 Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/Jersey.cs create mode 100644 Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/Leather.cs create mode 100644 Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/Linen.cs create mode 100644 Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/Lycra.cs create mode 100644 Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/Mesh.cs create mode 100644 Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/MicroFiber.cs create mode 100644 Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/Nylon.cs create mode 100644 Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/Pique.cs create mode 100644 Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/PolyCotton.cs create mode 100644 Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/Polyester.cs create mode 100644 Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/PureCotton.cs create mode 100644 Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/Rayon.cs (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views') diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf index 2a2bb2670..eb37646b5 100644 Binary files a/Software/DB/Tango.mdf and b/Software/DB/Tango.mdf differ diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf index fb985a544..cb71621e6 100644 Binary files a/Software/DB/Tango_log.ldf and b/Software/DB/Tango_log.ldf differ diff --git a/Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/EmbroideryMaterialsHelper.cs b/Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/EmbroideryMaterialsHelper.cs new file mode 100644 index 000000000..86704a2fd --- /dev/null +++ b/Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/EmbroideryMaterialsHelper.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.EmbroideryUI +{ + public static class EmbroideryMaterialsHelper + { + public static List GetAvailableEmbroideryMaterials() + { + List materials = new List(); + + foreach (var type in typeof(IEmbroideryMaterial).Assembly.GetTypes().Where(x => typeof(IEmbroideryMaterial).IsAssignableFrom(x) && !x.IsAbstract)) + { + materials.Add(Activator.CreateInstance(type) as IEmbroideryMaterial); + } + + return materials; + } + } +} diff --git a/Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/IEmbroideryMaterial.cs b/Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/IEmbroideryMaterial.cs new file mode 100644 index 000000000..e1d304086 --- /dev/null +++ b/Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/IEmbroideryMaterial.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.EmbroideryUI +{ + public interface IEmbroideryMaterial + { + double Coefficient { get; } + + String Name { get; } + } +} diff --git a/Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/Jersey.cs b/Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/Jersey.cs new file mode 100644 index 000000000..004a67940 --- /dev/null +++ b/Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/Jersey.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.EmbroideryUI.Materials +{ + public class Jersey : IEmbroideryMaterial + { + public double Coefficient + { + get + { + return 1; + } + } + + public string Name + { + get + { + return "Jersey"; + } + } + } +} diff --git a/Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/Leather.cs b/Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/Leather.cs new file mode 100644 index 000000000..5cf26d890 --- /dev/null +++ b/Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/Leather.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.EmbroideryUI.Materials +{ + public class Leather : IEmbroideryMaterial + { + public double Coefficient + { + get + { + return 1; + } + } + + public string Name + { + get + { + return "Leather"; + } + } + } +} diff --git a/Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/Linen.cs b/Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/Linen.cs new file mode 100644 index 000000000..db7f2fcaa --- /dev/null +++ b/Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/Linen.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.EmbroideryUI.Materials +{ + public class Linen : IEmbroideryMaterial + { + public double Coefficient + { + get + { + return 1; + } + } + + public string Name + { + get + { + return "Linen"; + } + } + } +} diff --git a/Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/Lycra.cs b/Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/Lycra.cs new file mode 100644 index 000000000..1e020d3f2 --- /dev/null +++ b/Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/Lycra.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.EmbroideryUI.Materials +{ + public class Lycra : IEmbroideryMaterial + { + public double Coefficient + { + get + { + return 1; + } + } + + public string Name + { + get + { + return "Lycra"; + } + } + } +} diff --git a/Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/Mesh.cs b/Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/Mesh.cs new file mode 100644 index 000000000..e99dd4823 --- /dev/null +++ b/Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/Mesh.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.EmbroideryUI.Materials +{ + public class Mesh : IEmbroideryMaterial + { + public double Coefficient + { + get + { + return 1; + } + } + + public string Name + { + get + { + return "Mesh"; + } + } + } +} diff --git a/Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/MicroFiber.cs b/Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/MicroFiber.cs new file mode 100644 index 000000000..51b16afe7 --- /dev/null +++ b/Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/MicroFiber.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.EmbroideryUI.Materials +{ + public class MicroFiber : IEmbroideryMaterial + { + public double Coefficient + { + get + { + return 1; + } + } + + public string Name + { + get + { + return "Micro Fiber"; + } + } + } +} diff --git a/Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/Nylon.cs b/Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/Nylon.cs new file mode 100644 index 000000000..9cf33d1ee --- /dev/null +++ b/Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/Nylon.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.EmbroideryUI.Materials +{ + public class Nylon : IEmbroideryMaterial + { + public double Coefficient + { + get + { + return 1; + } + } + + public string Name + { + get + { + return "Nylon"; + } + } + } +} diff --git a/Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/Pique.cs b/Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/Pique.cs new file mode 100644 index 000000000..1263b23d2 --- /dev/null +++ b/Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/Pique.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.EmbroideryUI.Materials +{ + public class Pique : IEmbroideryMaterial + { + public double Coefficient + { + get + { + return 1; + } + } + + public string Name + { + get + { + return "Pique"; + } + } + } +} diff --git a/Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/PolyCotton.cs b/Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/PolyCotton.cs new file mode 100644 index 000000000..7dacaa945 --- /dev/null +++ b/Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/PolyCotton.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.EmbroideryUI.Materials +{ + public class PolyCotton : IEmbroideryMaterial + { + public double Coefficient + { + get + { + return 1; + } + } + + public string Name + { + get + { + return "Poly Cotton"; + } + } + } +} diff --git a/Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/Polyester.cs b/Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/Polyester.cs new file mode 100644 index 000000000..7c915f138 --- /dev/null +++ b/Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/Polyester.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.EmbroideryUI.Materials +{ + public class Polyester : IEmbroideryMaterial + { + public double Coefficient + { + get + { + return 1; + } + } + + public string Name + { + get + { + return "Polyester"; + } + } + } +} diff --git a/Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/PureCotton.cs b/Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/PureCotton.cs new file mode 100644 index 000000000..270756af2 --- /dev/null +++ b/Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/PureCotton.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.EmbroideryUI.Materials +{ + public class PureCotton : IEmbroideryMaterial + { + public double Coefficient + { + get + { + return 1; + } + } + + public string Name + { + get + { + return "Pure Cotton"; + } + } + } +} diff --git a/Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/Rayon.cs b/Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/Rayon.cs new file mode 100644 index 000000000..e71258aba --- /dev/null +++ b/Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Materials/Rayon.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.EmbroideryUI.Materials +{ + public class Rayon : IEmbroideryMaterial + { + public double Coefficient + { + get + { + return 1; + } + } + + public string Name + { + get + { + return "Rayon"; + } + } + } +} diff --git a/Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Tango.EmbroideryUI.csproj b/Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Tango.EmbroideryUI.csproj index 9ef098618..11b779275 100644 --- a/Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Tango.EmbroideryUI.csproj +++ b/Software/Visual_Studio/Embroidery/Tango.EmbroideryUI/Tango.EmbroideryUI.csproj @@ -60,7 +60,21 @@ EmbroideryFileEditor.xaml + + + + + + + + + + + + + + Code diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/EmbroideryImportViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/EmbroideryImportViewVM.cs index 530893535..eaffab9e5 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/EmbroideryImportViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/EmbroideryImportViewVM.cs @@ -27,17 +27,50 @@ namespace Tango.MachineStudio.Developer.ViewModels public ObservableCollection Paths { get; set; } - private int _stitchLength; + public List EmbroideryMaterials { get; set; } - public int StitchLength + private IEmbroideryMaterial _selectedEmbroideryMaterial; + public IEmbroideryMaterial SelectedEmbroideryMaterial { - get { return _stitchLength; } - set { _stitchLength = value; RaisePropertyChangedAuto(); } + get { return _selectedEmbroideryMaterial; } + set { _selectedEmbroideryMaterial = value; RaisePropertyChangedAuto(); } + } + + private IEmbroideryMaterial _selectedStabilizer; + public IEmbroideryMaterial SelectedStabilizer + { + get { return _selectedStabilizer; } + set { _selectedStabilizer = value; RaisePropertyChangedAuto(); } + } + + private double _embroideryMaterialThickness; + public double EmbroideryMaterialThickness + { + get { return _embroideryMaterialThickness; } + set { _embroideryMaterialThickness = value; RaisePropertyChangedAuto(); } + } + + private double _stabilizerThickness; + public double StabilizerThickness + { + get { return _stabilizerThickness; } + set { _stabilizerThickness = value; RaisePropertyChangedAuto(); } + } + + private bool _hasStabilizer; + public bool HasStabilizer + { + get { return _hasStabilizer; } + set { _hasStabilizer = value; RaisePropertyChangedAuto(); } } public EmbroideryImportViewVM() : base() { - StitchLength = 6; + EmbroideryMaterials = EmbroideryMaterialsHelper.GetAvailableEmbroideryMaterials(); + SelectedEmbroideryMaterial = EmbroideryMaterials.FirstOrDefault(); + SelectedStabilizer = EmbroideryMaterials.FirstOrDefault(); + EmbroideryMaterialThickness = 1; + StabilizerThickness = 1; ImportCommand = new RelayCommand(Import); } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs index 218733819..566dc7a16 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs @@ -1639,7 +1639,7 @@ namespace Tango.MachineStudio.Developer.ViewModels if (jobName != null) { - AddJobFromEmbroideryFile(jobName, vm.Paths.ToList(), vm.StitchLength, vm.EmbroideryFile, dlg.FileName, view.EmbroideryImageBytes); + AddJobFromEmbroideryFile(jobName, vm, dlg.FileName, view.EmbroideryImageBytes); } }, () => @@ -1649,7 +1649,7 @@ namespace Tango.MachineStudio.Developer.ViewModels } } - private async void AddJobFromEmbroideryFile(String jobName, List paths, int stitchLength, EmbroideryFile embroideryFile, String fileName, byte[] imageBytes) + private async void AddJobFromEmbroideryFile(String jobName, EmbroideryImportViewVM vm, String fileName, byte[] imageBytes) { LogManager.Log(String.Format("Adding new job from embroidery file {0}...", jobName)); @@ -1668,12 +1668,23 @@ namespace Tango.MachineStudio.Developer.ViewModels job.EmbroideryJpeg = imageBytes; job.HasEmbroideryFile = true; - foreach (var path in paths.Skip(1)) + foreach (var path in vm.Paths.Skip(1)) { Segment segment = new Segment(); - segment.Length = (path.Length / 1000d) * 2d; + + double baseLength = path.Length / 1000d; + double embThicknessLength = (vm.EmbroideryMaterialThickness * path.StitchCount) / 1000d; + double stabilizerThicknessLength = (vm.StabilizerThickness * path.StitchCount) / 1000d; + double totalLength = (baseLength + embThicknessLength) * vm.SelectedEmbroideryMaterial.Coefficient; + + if (vm.HasStabilizer) + { + totalLength += (stabilizerThicknessLength * vm.SelectedStabilizer.Coefficient); + } + + segment.Length = totalLength; segment.Name = "Embroidery Segment"; - segment.SegmentIndex = paths.IndexOf(path) + 2; + segment.SegmentIndex = vm.Paths.IndexOf(path) + 2; if (path.Brush is SolidColorBrush) { diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/EmbroideryImportView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/EmbroideryImportView.xaml index 17a5a5b8c..42d0bb106 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/EmbroideryImportView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/EmbroideryImportView.xaml @@ -45,10 +45,33 @@ Region Brush - + + + - - + + + + + + + + + + + + + + + + + + + + + -- cgit v1.3.1