aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/SpoolsView.xaml
blob: 3641492dfb166e9e4aa2a7779b89fbebd8b02b9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<UserControl x:Class="Tango.MachineStudio.MachineDesigner.Views.SpoolsView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:vm="clr-namespace:Tango.MachineStudio.MachineDesigner.ViewModels"
             xmlns:global="clr-namespace:Tango.MachineStudio.MachineDesigner"
              xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls"
             xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI"
             xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
             xmlns:local="clr-namespace:Tango.MachineStudio.MachineDesigner.Views"
             mc:Ignorable="d" 
             d:DesignHeight="720" d:DesignWidth="1280" Background="Transparent" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}">
    <Grid Margin="20">
        <DockPanel>
            <Grid DockPanel.Dock="Bottom">

            </Grid>

            <Grid Margin="0 20">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="38*"/>
                    <ColumnDefinition Width="117*"/>
                </Grid.ColumnDefinitions>

                <local:MachineView Margin="30 80 0 0" DataContext="{Binding ActiveMachine}" IsHitTestVisible="False" VerticalAlignment="Top" Height="241" />

                <DockPanel Grid.Column="1" Margin="50 100">
                    <Grid DockPanel.Dock="Bottom">
                        <StackPanel VerticalAlignment="Center" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0 0 0 0">
                            <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="{StaticResource RedBrush300}" BorderBrush="{StaticResource RedBrush300}" Command="{Binding RemoveSpoolCommand}">
                                <StackPanel Orientation="Horizontal">
                                    <materialDesign:PackIcon Kind="Delete" Width="20" Height="20" />
                                    <TextBlock Margin="5 0 0 0" FontSize="16">DELETE</TextBlock>
                                </StackPanel>
                            </Button>
                            <Button Margin="0 0 0 0" MinWidth="160" Height="50" Background="{StaticResource GreenBrush300}" BorderBrush="{StaticResource GreenBrush300}" Command="{Binding AddSpoolCommand}">
                                <StackPanel Orientation="Horizontal">
                                    <materialDesign:PackIcon Kind="Plus" Width="20" Height="20" />
                                    <TextBlock Margin="5 0 0 0" FontSize="16">NEW SPOOL</TextBlock>
                                </StackPanel>
                            </Button>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">

                        </StackPanel>
                    </Grid>
                    <Grid>
                        <DataGrid Margin="0 0 0 10" SelectionUnit="FullRow" BorderBrush="Silver" BorderThickness="1" Background="#93FFFFFF" AlternatingRowBackground="#C9F6F6F6" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" ItemsSource="{Binding ActiveMachine.Spools}" SelectedItem="{Binding SelectedSpool}">
                            <DataGrid.CellStyle>
                                <Style TargetType="DataGridCell" BasedOn="{StaticResource {x:Type DataGridCell}}">
                                    <Setter Property="BorderThickness" Value="0"/>
                                    <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
                                    <Setter Property="VerticalContentAlignment" Value="Center"></Setter>
                                </Style>
                            </DataGrid.CellStyle>
                            <DataGrid.Columns>
                                <DataGridComboBoxColumn Header="SPOOL TYPE" SelectedItemBinding="{Binding SpoolType}" DisplayMemberPath="Name" Width="Auto">
                                    <DataGridComboBoxColumn.ElementStyle>
                                        <Style TargetType="ComboBox">
                                            <Setter Property="ItemsSource" Value="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid},Path=DataContext.ActiveMachineAdapter.SpoolTypes}"/>
                                        </Style>
                                    </DataGridComboBoxColumn.ElementStyle>
                                    <DataGridComboBoxColumn.EditingElementStyle>
                                        <Style TargetType="ComboBox">
                                            <Setter Property="ItemsSource" Value="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid},Path=DataContext.ActiveMachineAdapter.SpoolTypes}"/>
                                        </Style>
                                    </DataGridComboBoxColumn.EditingElementStyle>
                                </DataGridComboBoxColumn>
                                <DataGridTextColumn Header="START OFFSET PULSES" Binding="{Binding StartOffsetPulses}" Width="Auto" />
                                <DataGridTextColumn Header="BACKING RATE" Binding="{Binding BackingRate}" Width="Auto" />
                                <DataGridTextColumn Header="SEGMENT OFFSET PULSES" Binding="{Binding SegmentOffsetPulses}" Width="Auto" />
                                <DataGridTextColumn Header="BOTTOM BACKING RATE" Binding="{Binding BottomBackingRate}" Width="1*" />
                            </DataGrid.Columns>
                        </DataGrid>
                    </Grid>
                </DockPanel>
            </Grid>
        </DockPanel>
    </Grid>
</UserControl>