diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-01-28 19:40:35 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-01-28 19:40:35 +0200 |
| commit | 7e8ff4c3ca798d426eb6f381c5312a747f1bb800 (patch) | |
| tree | cf9702617f9771412c78294ad742c308007ebce1 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml | |
| parent | 10eec8df1dfce197b31d51cfa49746b0ce07a5e5 (diff) | |
| download | Tango-7e8ff4c3ca798d426eb6f381c5312a747f1bb800.tar.gz Tango-7e8ff4c3ca798d426eb6f381c5312a747f1bb800.zip | |
Implemented all color spaces on segment brushes (simple conversion).
Embedded ColorMine library as a SideChain.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml | 227 |
1 files changed, 197 insertions, 30 deletions
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 e7aa85fb8..73c00fea8 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 @@ -7,6 +7,7 @@ xmlns:global="clr-namespace:Tango.MachineStudio.Developer" xmlns:dragAndDrop="clr-namespace:Tango.DragAndDrop;assembly=Tango.DragAndDrop" xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:colorPicker="clr-namespace:Tango;assembly=Tango.ColorPicker" xmlns:db="clr-namespace:Tango.MachineStudio.DB.Views.DBViews;assembly=Tango.MachineStudio.DB" xmlns:commonControls="clr-namespace:Tango.MachineStudio.Common.Controls;assembly=Tango.MachineStudio.Common" xmlns:designer="clr-namespace:Tango.MachineStudio.MachineDesigner.Views;assembly=Tango.MachineStudio.MachineDesigner" @@ -22,7 +23,7 @@ <UserControl.Resources> <Style TargetType="{x:Type TabItem}" BasedOn="{StaticResource {x:Type TabItem}}"> - <Setter Property="mahapps:ControlsHelper.HeaderFontSize" Value="18" /> + <Setter Property="mahapps:ControlsHelper.HeaderFontSize" Value="14" /> <Setter Property="Margin" Value="2" /> </Style> @@ -31,6 +32,9 @@ <converters:NullObjectToBooleanConverter x:Key="NullObjectToBooleanConverter"></converters:NullObjectToBooleanConverter> <converters:GreaterThanToBooleanConverter x:Key="GreaterThanToBooleanConverter"></converters:GreaterThanToBooleanConverter> <converters:SmallerThanToBooleanConverter x:Key="SmallerThanToBooleanConverter"></converters:SmallerThanToBooleanConverter> + <localConverters:BrushStopToColorConverter x:Key="BrushStopToColorConverter" /> + <localConverters:BrushStopCMYKToColorConverter x:Key="BrushStopCMYKToColorConverter" /> + <localConverters:BrushStopLabToColorConverter x:Key="BrushStopLabToColorConverter" /> <SolidColorBrush x:Key="SideBarBackground" Color="#F9F9F9"> @@ -291,7 +295,7 @@ <Grid> <Grid.RowDefinitions> <RowDefinition Height="234*"/> - <RowDefinition Height="161*"/> + <RowDefinition x:Name="graphRowDefinition" Height="161*"/> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="173*"/> @@ -311,10 +315,10 @@ <Rectangle VerticalAlignment="Bottom" StrokeDashArray="7" StrokeThickness="1" Stroke="Silver" Margin="0 8 0 0"></Rectangle> </StackPanel> <StackPanel Orientation="Horizontal" DockPanel.Dock="Bottom" HorizontalAlignment="Right"> - <Button Command="{Binding RemoveJobCommand}" Margin="5" Style="{StaticResource MaterialDesignFlatButton}" Padding="0" ToolTip="Remove Segment"> + <Button Command="{Binding RemoveJobCommand}" Margin="5" Style="{StaticResource MaterialDesignFlatButton}" Padding="0" ToolTip="Remove Job"> <materialDesign:PackIcon Kind="MinusCircleOutline" Width="24" Height="24"></materialDesign:PackIcon> </Button> - <Button Command="{Binding AddJobCommand}" Margin="5" Style="{StaticResource MaterialDesignFlatButton}" Padding="0" ToolTip="Add Segment"> + <Button Command="{Binding AddJobCommand}" Margin="5" Style="{StaticResource MaterialDesignFlatButton}" Padding="0" ToolTip="Add Job"> <materialDesign:PackIcon Kind="PlusCircleOutline" Width="24" Height="24"></materialDesign:PackIcon> </Button> </StackPanel> @@ -488,10 +492,10 @@ <Grid DockPanel.Dock="Bottom"> <StackPanel Orientation="Horizontal" DockPanel.Dock="Bottom" HorizontalAlignment="Right"> - <Button Command="{Binding RemoveBrushStopCommand}" Margin="5" Style="{StaticResource MaterialDesignFlatButton}" Padding="0" ToolTip="Remove Segment"> + <Button Command="{Binding RemoveBrushStopCommand}" Margin="5" Style="{StaticResource MaterialDesignFlatButton}" Padding="0" ToolTip="Remove Color"> <materialDesign:PackIcon Kind="MinusCircleOutline" Width="24" Height="24"></materialDesign:PackIcon> </Button> - <Button Command="{Binding AddBrushStopCommand}" Margin="5" Style="{StaticResource MaterialDesignFlatButton}" Padding="0" ToolTip="Add Segment"> + <Button Command="{Binding AddBrushStopCommand}" Margin="5" Style="{StaticResource MaterialDesignFlatButton}" Padding="0" ToolTip="Add Color"> <materialDesign:PackIcon Kind="PlusCircleOutline" Width="24" Height="24"></materialDesign:PackIcon> </Button> </StackPanel> @@ -527,31 +531,189 @@ </Border.Style> <Grid> <DockPanel> - <StackPanel DockPanel.Dock="Left" VerticalAlignment="Center"> - <ItemsControl ItemsSource="{Binding InkVolumes}" VerticalAlignment="Center"> - <ItemsControl.ItemsPanel> - <ItemsPanelTemplate> - <StackPanel VerticalAlignment="Center" Orientation="Horizontal" IsItemsHost="True"></StackPanel> - </ItemsPanelTemplate> - </ItemsControl.ItemsPanel> - <ItemsControl.ItemTemplate> - <DataTemplate> - <Border BorderThickness="1" Width="50" Height="50" CornerRadius="50" Margin="10 0 0 0"> - <Border.BorderBrush> - <SolidColorBrush Color="{Binding IdsPack.LiquidType.Color,Converter={StaticResource ColorToIntegerConverter}}"></SolidColorBrush> - </Border.BorderBrush> - <mahapps:NumericUpDown FontSize="14" FontFamily="digital-7" HorizontalAlignment="Center" Value="{Binding Volume, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.0" HideUpDownButtons="True" Minimum="0" Maximum="1000" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> - <mahapps:NumericUpDown.Resources> - <Style TargetType="TextBox"> + <ContentControl DockPanel.Dock="Left"> + <ContentControl.Style> + <Style TargetType="ContentControl"> + <Setter Property="Content"> + <Setter.Value> + <Rectangle/> + </Setter.Value> + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding ColorSpace.Name}" Value="Volume"> + <Setter Property="Content"> + <Setter.Value> + <StackPanel VerticalAlignment="Center"> + <ItemsControl ItemsSource="{Binding InkVolumes}" VerticalAlignment="Center"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <StackPanel VerticalAlignment="Center" Orientation="Horizontal" IsItemsHost="True"></StackPanel> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + <ItemsControl.ItemTemplate> + <DataTemplate> + <Border BorderThickness="1" Width="50" Height="50" CornerRadius="50" Margin="10 0 0 0"> + <Border.BorderBrush> + <SolidColorBrush Color="{Binding IdsPack.LiquidType.Color,Converter={StaticResource ColorToIntegerConverter}}"></SolidColorBrush> + </Border.BorderBrush> + <mahapps:NumericUpDown FontSize="14" FontFamily="digital-7" HorizontalAlignment="Center" Value="{Binding Volume, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.0" HideUpDownButtons="True" Minimum="0" Maximum="1000" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> + <mahapps:NumericUpDown.Resources> + <Style TargetType="TextBox"/> + </mahapps:NumericUpDown.Resources> + </mahapps:NumericUpDown> + </Border> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + </StackPanel> + </Setter.Value> + </Setter> + </DataTrigger> + <DataTrigger Binding="{Binding ColorSpace.Name}" Value="RGB"> + <Setter Property="Content"> + <Setter.Value> + <StackPanel Orientation="Horizontal"> + <Border BorderThickness="1" Width="50" Height="50" CornerRadius="50" Margin="10 0 0 0" BorderBrush="#FF6F6F"> + <mahapps:NumericUpDown FontSize="14" FontFamily="digital-7" HorizontalAlignment="Center" Value="{Binding Red, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="255" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Center"> + <mahapps:NumericUpDown.Resources> + <Style TargetType="TextBox"/> + </mahapps:NumericUpDown.Resources> + </mahapps:NumericUpDown> + </Border> + + <Border BorderThickness="1" Width="50" Height="50" CornerRadius="50" Margin="10 0 0 0" BorderBrush="#92FF92"> + <mahapps:NumericUpDown FontSize="14" FontFamily="digital-7" HorizontalAlignment="Center" Value="{Binding Green, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="255" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Center"> + <mahapps:NumericUpDown.Resources> + <Style TargetType="TextBox"/> + </mahapps:NumericUpDown.Resources> + </mahapps:NumericUpDown> + </Border> + + <Border BorderThickness="1" Width="50" Height="50" CornerRadius="50" Margin="10 0 0 0" BorderBrush="#3C7EF4"> + <mahapps:NumericUpDown FontSize="14" FontFamily="digital-7" HorizontalAlignment="Center" Value="{Binding Blue, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="255" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Center"> + <mahapps:NumericUpDown.Resources> + <Style TargetType="TextBox"/> + </mahapps:NumericUpDown.Resources> + </mahapps:NumericUpDown> + </Border> + + <colorPicker:ColorPickerCombo Margin="30 0 0 0" VerticalAlignment="Center" Width="100" BorderBrush="{StaticResource AccentColorBrush}" Background="White"> + <colorPicker:ColorPickerCombo.SelectedColor> + <MultiBinding Converter="{StaticResource BrushStopToColorConverter}"> + <Binding Path="Red"></Binding> + <Binding Path="Green"></Binding> + <Binding Path="Blue"></Binding> + </MultiBinding> + </colorPicker:ColorPickerCombo.SelectedColor> + </colorPicker:ColorPickerCombo> + </StackPanel> + </Setter.Value> + </Setter> + </DataTrigger> + <DataTrigger Binding="{Binding ColorSpace.Name}" Value="CMYK"> + <Setter Property="Content"> + <Setter.Value> + <StackPanel Orientation="Horizontal"> + <Border BorderThickness="1" Width="50" Height="50" CornerRadius="50" Margin="10 0 0 0" BorderBrush="Cyan"> + <mahapps:NumericUpDown FontSize="14" FontFamily="digital-7" HorizontalAlignment="Center" Value="{Binding Cyan, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> + <mahapps:NumericUpDown.Resources> + <Style TargetType="TextBox"/> + </mahapps:NumericUpDown.Resources> + </mahapps:NumericUpDown> + </Border> + + <Border BorderThickness="1" Width="50" Height="50" CornerRadius="50" Margin="10 0 0 0" BorderBrush="Magenta"> + <mahapps:NumericUpDown FontSize="14" FontFamily="digital-7" HorizontalAlignment="Center" Value="{Binding Magenta, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> + <mahapps:NumericUpDown.Resources> + <Style TargetType="TextBox"/> + </mahapps:NumericUpDown.Resources> + </mahapps:NumericUpDown> + </Border> + + <Border BorderThickness="1" Width="50" Height="50" CornerRadius="50" Margin="10 0 0 0" BorderBrush="Yellow"> + <mahapps:NumericUpDown FontSize="14" FontFamily="digital-7" HorizontalAlignment="Center" Value="{Binding Yellow, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> + <mahapps:NumericUpDown.Resources> + <Style TargetType="TextBox"/> + </mahapps:NumericUpDown.Resources> + </mahapps:NumericUpDown> + </Border> + + <Border BorderThickness="1" Width="50" Height="50" CornerRadius="50" Margin="10 0 0 0" BorderBrush="Black"> + <mahapps:NumericUpDown FontSize="14" FontFamily="digital-7" HorizontalAlignment="Center" Value="{Binding Black, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> + <mahapps:NumericUpDown.Resources> + <Style TargetType="TextBox"/> + </mahapps:NumericUpDown.Resources> + </mahapps:NumericUpDown> + </Border> + + <Rectangle Margin="30 0 0 0" Width="50" Height="50" StrokeThickness="1" Stroke="Gray"> + <Rectangle.Fill> + <SolidColorBrush> + <SolidColorBrush.Color> + <MultiBinding Converter="{StaticResource BrushStopCMYKToColorConverter}"> + <Binding Path="Cyan"></Binding> + <Binding Path="Magenta"></Binding> + <Binding Path="Yellow"></Binding> + <Binding Path="Black"></Binding> + </MultiBinding> + </SolidColorBrush.Color> + </SolidColorBrush> + </Rectangle.Fill> + </Rectangle> + </StackPanel> + </Setter.Value> + </Setter> + </DataTrigger> + <DataTrigger Binding="{Binding ColorSpace.Name}" Value="LAB"> + <Setter Property="Content"> + <Setter.Value> + <StackPanel Orientation="Horizontal"> + <Border BorderThickness="1" Width="50" Height="50" CornerRadius="50" Margin="10 0 0 0" BorderBrush="Gray"> + <mahapps:NumericUpDown FontSize="14" FontFamily="digital-7" HorizontalAlignment="Center" Value="{Binding L, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.0" HideUpDownButtons="True" Minimum="-100" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> + <mahapps:NumericUpDown.Resources> + <Style TargetType="TextBox"/> + </mahapps:NumericUpDown.Resources> + </mahapps:NumericUpDown> + </Border> + + <Border BorderThickness="1" Width="50" Height="50" CornerRadius="50" Margin="10 0 0 0" BorderBrush="#FF8A8A"> + <mahapps:NumericUpDown FontSize="14" FontFamily="digital-7" HorizontalAlignment="Center" Value="{Binding A, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.0" HideUpDownButtons="True" Minimum="-100" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> + <mahapps:NumericUpDown.Resources> + <Style TargetType="TextBox"/> + </mahapps:NumericUpDown.Resources> + </mahapps:NumericUpDown> + </Border> + + <Border BorderThickness="1" Width="50" Height="50" CornerRadius="50" Margin="10 0 0 0" BorderBrush="#FFFF8A"> + <mahapps:NumericUpDown FontSize="14" FontFamily="digital-7" HorizontalAlignment="Center" Value="{Binding B, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.0" HideUpDownButtons="True" Minimum="-100" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> + <mahapps:NumericUpDown.Resources> + <Style TargetType="TextBox"/> + </mahapps:NumericUpDown.Resources> + </mahapps:NumericUpDown> + </Border> + + <Rectangle Margin="30 0 0 0" Width="50" Height="50" StrokeThickness="1" Stroke="Gray"> + <Rectangle.Fill> + <SolidColorBrush> + <SolidColorBrush.Color> + <MultiBinding Converter="{StaticResource BrushStopLabToColorConverter}"> + <Binding Path="L"></Binding> + <Binding Path="A"></Binding> + <Binding Path="B"></Binding> + </MultiBinding> + </SolidColorBrush.Color> + </SolidColorBrush> + </Rectangle.Fill> + </Rectangle> + </StackPanel> + </Setter.Value> + </Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </ContentControl.Style> + </ContentControl> - </Style> - </mahapps:NumericUpDown.Resources> - </mahapps:NumericUpDown> - </Border> - </DataTemplate> - </ItemsControl.ItemTemplate> - </ItemsControl> - </StackPanel> <Grid DockPanel.Dock="Right"> <Border Style="{StaticResource JobFieldBorder}"> <StackPanel Margin="5" Width="140"> @@ -772,6 +934,11 @@ </LinearGradientBrush> </Border.Background> + + <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0 0 120 0"> + <ToggleButton x:Name="chkGraphs" IsChecked="True"></ToggleButton> + <TextBlock VerticalAlignment="Center" Margin="5 -1 0 0" Foreground="Gray">Show Graphs</TextBlock> + </StackPanel> </Border> <dragAndDrop:DraggingSurface x:Name="draggingSurface" /> </Grid> |
