aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/EmbroideryImportViewVM.cs9
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs6
2 files changed, 12 insertions, 3 deletions
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 a0f4314dc..530893535 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,8 +27,17 @@ namespace Tango.MachineStudio.Developer.ViewModels
public ObservableCollection<EmbroideryPath> Paths { get; set; }
+ private int _stitchLength;
+
+ public int StitchLength
+ {
+ get { return _stitchLength; }
+ set { _stitchLength = value; RaisePropertyChangedAuto(); }
+ }
+
public EmbroideryImportViewVM() : base()
{
+ StitchLength = 6;
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 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;