aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs
diff options
context:
space:
mode:
authorRoy <roy.mail.net@gmail.com>2018-03-05 09:12:59 +0200
committerRoy <roy.mail.net@gmail.com>2018-03-05 09:12:59 +0200
commit8e2cbf02b6c819e92ee4eec2a673586438edfa93 (patch)
treec12fd2c91c5abb4cae725ac39792c69b25118faa /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs
parent2b8e41b5279c2d3ab370595f6593b64ea734ef87 (diff)
downloadTango-8e2cbf02b6c819e92ee4eec2a673586438edfa93.tar.gz
Tango-8e2cbf02b6c819e92ee4eec2a673586438edfa93.zip
Some work on embroidery import/export.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs6
1 files changed, 3 insertions, 3 deletions
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<EmbroideryPath> paths, EmbroideryFile embroideryFile, String fileName, byte[] imageBytes)
+ private async void AddJobFromEmbroideryFile(String jobName, List<EmbroideryPath> 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;