diff options
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views')
7 files changed, 116 insertions, 7 deletions
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 @@ +<UserControl x:Class="Tango.MachineStudio.Developer.Views.EmbroideryDisplayView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + 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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + 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}"> + + <UserControl.Resources> + <converters:ByteArrayToBitmapSourceConverter x:Key="ByteArrayToBitmapSourceConverter" /> + </UserControl.Resources> + + <Grid> + <Grid> + <Grid.RowDefinitions> + <RowDefinition Height="60"/> + <RowDefinition Height="593*"/> + <RowDefinition Height="60"/> + </Grid.RowDefinitions> + + <Grid> + <StackPanel Orientation="Horizontal"> + <Image Source="../Images/sewing-machine.png" Width="48"></Image> + <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" FontSize="20" Text="{Binding Job.EmbroideryFileName}"></TextBlock> + </StackPanel> + + <Rectangle VerticalAlignment="Bottom" Stroke="Silver"></Rectangle> + </Grid> + + <Grid Grid.Row="1"> + <Image HorizontalAlignment="Center" VerticalAlignment="Center" Source="{Binding Job.EmbroideryJpeg,Converter={StaticResource ByteArrayToBitmapSourceConverter}}"></Image> + </Grid> + + <Grid Grid.Row="2"> + <StackPanel Orientation="Horizontal" HorizontalAlignment="Right"> + <Button Height="40" Command="{Binding ExportCommand}"> + <StackPanel Orientation="Horizontal"> + <materialDesign:PackIcon Kind="Export" Width="24" Height="24" /> + <TextBlock Margin="5 0 0 0" FontSize="16">EXPORT</TextBlock> + </StackPanel> + </Button> + </StackPanel> + </Grid> + </Grid> + </Grid> +</UserControl> 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 +{ + /// <summary> + /// Interaction logic for EmbroideryDisplayView.xaml + /// </summary> + 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 @@ </Grid> <Grid Grid.Row="2" Grid.Column="1"> - <Button Height="50" Command="{Binding ImportCommand}"> + <Button Height="50" Click="OnImportClick" Command="{Binding ImportCommand}"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon Kind="Import" Width="24" Height="24" /> <TextBlock Margin="5 0 0 0" FontSize="16">IMPORT</TextBlock> 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 c34b6fef7..ce481a87b 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 @@ -12,6 +12,7 @@ using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; +using Tango.SharedUI.Helpers; namespace Tango.MachineStudio.Developer.Views { @@ -20,9 +21,17 @@ namespace Tango.MachineStudio.Developer.Views /// </summary> public partial class EmbroideryImportView : UserControl { + public byte[] EmbroideryImageBytes { get; set; } + public EmbroideryImportView() { InitializeComponent(); } + + private void OnImportClick(object sender, RoutedEventArgs e) + { + var source = UIHelper.TakeSnapshot(editor); + EmbroideryImageBytes = source.ToJpegBytes(50); + } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml index 9ba41f688..1dea01de7 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml @@ -438,13 +438,13 @@ <Grid HorizontalAlignment="Right" Margin="0 0 10 0"> <StackPanel Orientation="Horizontal"> - <Button Height="70" Width="135" Margin="0 0 10 0" Background="White" Foreground="#202020" VerticalAlignment="Bottom" BorderBrush="Transparent" Command="{Binding DiscardJobCommand}"> + <Button Height="70" Width="100" Margin="0 0 10 0" Style="{StaticResource MaterialDesignFlatButton}" Foreground="#202020" VerticalAlignment="Bottom" BorderBrush="Transparent" Command="{Binding DiscardJobCommand}"> <StackPanel> <materialDesign:PackIcon HorizontalAlignment="Center" Width="24" Height="24" Kind="KeyboardBackspace" /> <TextBlock VerticalAlignment="Center" Margin="0 10 0 0">TO JOBS</TextBlock> </StackPanel> </Button> - <Button Height="70" Width="135" Margin="0 0 0 0" Background="White" Foreground="#202020" VerticalAlignment="Bottom" BorderBrush="Transparent" Command="{Binding SaveJobCommand}"> + <Button Height="70" Width="100" Margin="0 0 0 0" Style="{StaticResource MaterialDesignFlatButton}" Foreground="#202020" VerticalAlignment="Bottom" BorderBrush="Transparent" Command="{Binding SaveJobCommand}"> <StackPanel> <materialDesign:PackIcon HorizontalAlignment="Center" Width="24" Height="24" Kind="ContentSave" /> <TextBlock VerticalAlignment="Center" Margin="0 10 0 0">SAVE JOB</TextBlock> 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 2115f2503..ebacd122c 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 @@ -131,8 +131,29 @@ <DataGrid.Columns> <DataGridTemplateColumn> <DataGridTemplateColumn.CellTemplate> - <DataTemplate> - <Image Source="../Images/rgb.png" Width="40" Margin="5"></Image> + <DataTemplate DataType="{x:Type observables:Job}"> + <ContentControl> + <ContentControl.Style> + <Style TargetType="ContentControl"> + <Setter Property="Content"> + <Setter.Value> + <Image Source="../Images/rgb.png" Width="40" Margin="5"></Image> + </Setter.Value> + </Setter> + <Style.Triggers> + <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}"> + <Image Source="../Images/job-emb.png" Width="40" Margin="5"></Image> + </Button> + </Setter.Value> + </Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </ContentControl.Style> + </ContentControl> </DataTemplate> </DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml index 7a50a499e..c4915a4c8 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml @@ -132,7 +132,7 @@ <StackPanel Margin="0 0 0 0" HorizontalAlignment="Center" VerticalAlignment="Center"> <TextBlock Margin="0 0 0 0" FontSize="14" HorizontalAlignment="Right"> - <Run Text="{Binding Length,Mode=OneWay}"></Run> + <Run Text="{Binding Length,Mode=OneWay,StringFormat=N2}"></Run> <Run FontSize="12" Text="m"></Run> </TextBlock> <materialDesign:PackIcon HorizontalAlignment="Center" RenderTransformOrigin="0.5,0.5" Kind="Triangle" Width="12" Height="12"> @@ -197,7 +197,7 @@ <StackPanel Margin="0 -5 -40 0" HorizontalAlignment="Right"> <TextBlock FontSize="14"> - <Run Text="{Binding RunningJob.Length,Mode=OneWay}"></Run> + <Run Text="{Binding RunningJob.Length,Mode=OneWay,StringFormat=N2}"></Run> <Run FontSize="13" Text="m"></Run> </TextBlock> <materialDesign:PackIcon HorizontalAlignment="Right" RenderTransformOrigin="0.5,0.5" Kind="FlagCheckered" Width="20" Height="20"> |
