From 8e2cbf02b6c819e92ee4eec2a673586438edfa93 Mon Sep 17 00:00:00 2001 From: Roy Date: Mon, 5 Mar 2018 09:12:59 +0200 Subject: Some work on embroidery import/export. --- .../Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs') 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 76fe33a87..aef928486 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.EmbroideryFile, dlg.FileName, view.EmbroideryImageBytes); + AddJobFromEmbroideryFile(jobName, vm.Paths.ToList(), vm.StitchLength, vm.EmbroideryFile, dlg.FileName, view.EmbroideryImageBytes); } }, () => @@ -1649,7 +1649,7 @@ namespace Tango.MachineStudio.Developer.ViewModels } } - private async void AddJobFromEmbroideryFile(String jobName, List paths, EmbroideryFile embroideryFile, String fileName, byte[] imageBytes) + private async void AddJobFromEmbroideryFile(String jobName, List paths, int stitchLength, EmbroideryFile embroideryFile, String fileName, byte[] imageBytes) { LogManager.Log(String.Format("Adding new job from embroidery file {0}...", jobName)); @@ -1671,7 +1671,7 @@ namespace Tango.MachineStudio.Developer.ViewModels foreach (var path in paths.Skip(1)) { Segment segment = new Segment(); - segment.Length = path.Length / 1000d; + segment.Length = ((double)path.StitchCount * (double)stitchLength) / 1000d; segment.Name = "Embroidery Segment"; segment.SegmentIndex = paths.IndexOf(path) + 2; -- cgit v1.3.1