aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/seamless-grid.jpgbin0 -> 12022 bytes
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj3
-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
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/EmbroideryDisplayView.xaml10
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/EmbroideryImportView.xaml16
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/EmbroideryImportView.xaml.cs2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml4
8 files changed, 40 insertions, 10 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/seamless-grid.jpg b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/seamless-grid.jpg
new file mode 100644
index 000000000..59bb9c370
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/seamless-grid.jpg
Binary files differ
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj
index 378fb443b..0e64872f7 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj
@@ -353,5 +353,8 @@
<ItemGroup>
<EmbeddedResource Include="bip.wav" />
</ItemGroup>
+ <ItemGroup>
+ <Resource Include="Images\seamless-grid.jpg" />
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project> \ No newline at end of file
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;
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
index a753453f9..22414b4b2 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/EmbroideryDisplayView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/EmbroideryDisplayView.xaml
@@ -9,7 +9,7 @@
xmlns:converters="clr-namespace:Tango.MachineStudio.Developer.Converters"
xmlns:local="clr-namespace:Tango.MachineStudio.Developer.Views"
mc:Ignorable="d"
- Width="600" Height="350" Background="White" d:DataContext="{d:DesignInstance Type=vm:EmbroideryDisplayViewVM, IsDesignTimeCreatable=False}">
+ Width="1280" Height="720" Background="White" d:DataContext="{d:DesignInstance Type=vm:EmbroideryDisplayViewVM, IsDesignTimeCreatable=False}">
<UserControl.Resources>
<converters:ByteArrayToBitmapSourceConverter x:Key="ByteArrayToBitmapSourceConverter" />
@@ -33,12 +33,18 @@
</Grid>
<Grid Grid.Row="1">
+ <Grid.Background>
+ <ImageBrush ImageSource="../Images/seamless-grid.jpg" Stretch="None" Opacity="0.5" TileMode="Tile" ViewportUnits="Absolute" Viewport="0,0,32,32"></ImageBrush>
+ </Grid.Background>
+ <Rectangle HorizontalAlignment="Left" Stroke="Silver"></Rectangle>
+ <Rectangle HorizontalAlignment="Right" Stroke="Silver"></Rectangle>
<Image HorizontalAlignment="Center" VerticalAlignment="Center" Source="{Binding Job.EmbroideryJpeg,Converter={StaticResource ByteArrayToBitmapSourceConverter}}"></Image>
</Grid>
<Grid Grid.Row="2">
+ <Rectangle VerticalAlignment="Top" Stroke="Silver"></Rectangle>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
- <Button Height="40" Command="{Binding ExportCommand}">
+ <Button Height="50" Command="{Binding ExportCommand}" Width="180">
<StackPanel Orientation="Horizontal">
<materialDesign:PackIcon Kind="Export" Width="24" Height="24" />
<TextBlock Margin="5 0 0 0" FontSize="16">EXPORT</TextBlock>
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 d084aabcf..17a5a5b8c 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
@@ -6,6 +6,7 @@
xmlns:emb="clr-namespace:Tango.EmbroideryUI;assembly=Tango.EmbroideryUI"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:vm="clr-namespace:Tango.MachineStudio.Developer.ViewModels"
+ xmlns:mahApps="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:brushPicker="clr-namespace:Tango.BrushPicker;assembly=Tango.BrushPicker"
xmlns:local="clr-namespace:Tango.MachineStudio.Developer.Views"
mc:Ignorable="d"
@@ -33,19 +34,30 @@
<Rectangle VerticalAlignment="Bottom" Stroke="Silver"></Rectangle>
</Grid>
- <Grid Grid.Row="1">
- <emb:EmbroideryFileEditor x:Name="editor" Background="White" FileName="{Binding FileName}" EmbroideryFile="{Binding EmbroideryFile,Mode=OneWayToSource}" Paths="{Binding Paths,Mode=OneWayToSource}" />
+ <Grid Grid.Row="1" x:Name="gridEditor">
+ <Grid.Background>
+ <ImageBrush ImageSource="../Images/seamless-grid.jpg" Stretch="None" Opacity="0.5" TileMode="Tile" ViewportUnits="Absolute" Viewport="0,0,32,32"></ImageBrush>
+ </Grid.Background>
+ <Rectangle HorizontalAlignment="Left" Stroke="Silver"></Rectangle>
+ <emb:EmbroideryFileEditor x:Name="editor" Background="Transparent" FileName="{Binding FileName}" EmbroideryFile="{Binding EmbroideryFile,Mode=OneWayToSource}" Paths="{Binding Paths,Mode=OneWayToSource}" />
</Grid>
<Grid Grid.Column="1" Grid.Row="1">
<StackPanel>
<TextBlock Margin="5">Region Brush</TextBlock>
<brushPicker:BrushPicker Margin="0 10 0 0" Background="White" BorderThickness="0" Brush="{Binding ElementName=editor,Path=SelectedPath.Brush,Mode=TwoWay}" />
+
+ <TextBlock Text="Stitch Length" Margin="5"></TextBlock>
+ <mahApps:NumericUpDown Margin="5" Minimum="1" Maximum="20" StringFormat="# mm" Value="{Binding StitchLength}" HasDecimals="False" HorizontalContentAlignment="Center" />
</StackPanel>
<Rectangle HorizontalAlignment="Left" Stroke="Silver" />
</Grid>
+ <Grid Grid.Row="2" Grid.ColumnSpan="2">
+ <Rectangle VerticalAlignment="Top" Stroke="Silver"></Rectangle>
+ </Grid>
+
<Grid Grid.Row="2" Grid.Column="1">
<Button Height="50" Click="OnImportClick" Command="{Binding ImportCommand}">
<StackPanel Orientation="Horizontal">
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/EmbroideryImportView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/EmbroideryImportView.xaml.cs
index ce481a87b..0b368a809 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/EmbroideryImportView.xaml.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/EmbroideryImportView.xaml.cs
@@ -30,7 +30,7 @@ namespace Tango.MachineStudio.Developer.Views
private void OnImportClick(object sender, RoutedEventArgs e)
{
- var source = UIHelper.TakeSnapshot(editor);
+ var source = UIHelper.TakeSnapshot(gridEditor);
EmbroideryImageBytes = source.ToJpegBytes(50);
}
}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml
index ebacd122c..a8274a4f7 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml
@@ -14,7 +14,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Tango.MachineStudio.Developer.Views"
mc:Ignorable="d"
- d:DesignHeight="1080" d:DesignWidth="1920" Background="Transparent" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}">
+ x:Name="control" d:DesignHeight="1080" d:DesignWidth="1920" Background="Transparent" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}">
<UserControl.Resources>
<localConverters:SegmentToBrushConverterMulti x:Key="SegmentToBrushConverterMulti" />
@@ -144,7 +144,7 @@
<DataTrigger Binding="{Binding HasEmbroideryFile}" Value="True">
<Setter Property="Content">
<Setter.Value>
- <Button ToolTip="Press to display the embroidery file information." Style="{StaticResource emptyButton}" Cursor="Hand" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.DisplayJobEmbroideryFileCommand}" CommandParameter="{Binding}">
+ <Button ToolTip="Press to display the attached embroidery file information" Style="{StaticResource emptyButton}" Cursor="Hand" Command="{Binding DataContext.DisplayJobEmbroideryFileCommand, Source={x:Reference control}}" CommandParameter="{Binding}">
<Image Source="../Images/job-emb.png" Width="40" Margin="5"></Image>
</Button>
</Setter.Value>