aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-01-28 19:40:35 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-01-28 19:40:35 +0200
commit7e8ff4c3ca798d426eb6f381c5312a747f1bb800 (patch)
treecf9702617f9771412c78294ad742c308007ebce1 /Software/Visual_Studio/MachineStudio/Modules
parent10eec8df1dfce197b31d51cfa49746b0ce07a5e5 (diff)
downloadTango-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')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/BrushStopCMYKToColorConverter.cs53
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/BrushStopLabToColorConverter.cs52
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/BrushStopToColorConverter.cs44
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj11
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml227
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs3
6 files changed, 360 insertions, 30 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/BrushStopCMYKToColorConverter.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/BrushStopCMYKToColorConverter.cs
new file mode 100644
index 000000000..e21da8fbc
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/BrushStopCMYKToColorConverter.cs
@@ -0,0 +1,53 @@
+using ColorMine.ColorSpaces;
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+using System.Windows.Media;
+using Tango.DAL.Observables;
+
+namespace Tango.MachineStudio.Developer.Converters
+{
+ public class BrushStopCMYKToColorConverter : IMultiValueConverter
+ {
+ public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
+ {
+ try
+ {
+ Cmyk cmyk = new Cmyk();
+
+ cmyk.C = System.Convert.ToDouble(values[0]) / 100d;
+ cmyk.M = System.Convert.ToDouble(values[1]) / 100d;
+ cmyk.Y = System.Convert.ToDouble(values[2]) / 100d;
+ cmyk.K = System.Convert.ToDouble(values[3]) / 100d;
+
+ IRgb rgb = cmyk.ToRgb();
+
+ return Color.FromRgb((byte)rgb.R, (byte)rgb.G, (byte)rgb.B);
+ }
+ catch
+ {
+ return null;
+ }
+ }
+
+ public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
+ {
+ try
+ {
+ Color color = (Color)value;
+ Rgb rgb = new Rgb(color.R, color.G, color.B);
+ Cmyk cmyk = rgb.To<Cmyk>();
+
+ return new object[] { cmyk.C * 100, cmyk.M * 100, cmyk.Y * 100, cmyk.K * 100 };
+ }
+ catch
+ {
+ return null;
+ }
+ }
+ }
+}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/BrushStopLabToColorConverter.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/BrushStopLabToColorConverter.cs
new file mode 100644
index 000000000..6c6d7959e
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/BrushStopLabToColorConverter.cs
@@ -0,0 +1,52 @@
+using ColorMine.ColorSpaces;
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+using System.Windows.Media;
+using Tango.DAL.Observables;
+
+namespace Tango.MachineStudio.Developer.Converters
+{
+ public class BrushStopLabToColorConverter : IMultiValueConverter
+ {
+ public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
+ {
+ try
+ {
+ Lab lab = new Lab();
+
+ lab.L = System.Convert.ToDouble(values[0]);
+ lab.A = System.Convert.ToDouble(values[1]);
+ lab.B = System.Convert.ToDouble(values[2]);
+
+ IRgb rgb = lab.ToRgb();
+
+ return Color.FromRgb((byte)rgb.R, (byte)rgb.G, (byte)rgb.B);
+ }
+ catch
+ {
+ return null;
+ }
+ }
+
+ public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
+ {
+ try
+ {
+ Color color = (Color)value;
+ Rgb rgb = new Rgb(color.R, color.G, color.B);
+ Lab cmyk = rgb.To<Lab>();
+
+ return new object[] { cmyk.L, cmyk.A, cmyk.B };
+ }
+ catch
+ {
+ return null;
+ }
+ }
+ }
+}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/BrushStopToColorConverter.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/BrushStopToColorConverter.cs
new file mode 100644
index 000000000..5db8d03c0
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/BrushStopToColorConverter.cs
@@ -0,0 +1,44 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+using System.Windows.Media;
+using Tango.DAL.Observables;
+
+namespace Tango.MachineStudio.Developer.Converters
+{
+ public class BrushStopToColorConverter : IMultiValueConverter
+ {
+ public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
+ {
+ try
+ {
+ double r = System.Convert.ToDouble(values[0]);
+ double g = System.Convert.ToDouble(values[1]);
+ double b = System.Convert.ToDouble(values[2]);
+
+ return Color.FromRgb((byte)r, (byte)g, (byte)b);
+ }
+ catch
+ {
+ return null;
+ }
+ }
+
+ public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
+ {
+ try
+ {
+ Color color = (Color)value;
+ return new object[] { color.R, color.G, color.B };
+ }
+ catch
+ {
+ return null;
+ }
+ }
+ }
+}
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 dc3f9947a..2bbd57b86 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
@@ -71,6 +71,9 @@
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
+ <Compile Include="Converters\BrushStopLabToColorConverter.cs" />
+ <Compile Include="Converters\BrushStopCMYKToColorConverter.cs" />
+ <Compile Include="Converters\BrushStopToColorConverter.cs" />
<Compile Include="Converters\DbRmlViewToEntityConverter.cs" />
<Compile Include="DeveloperModule.cs" />
<Compile Include="ViewModelLocator.cs" />
@@ -117,10 +120,18 @@
</None>
</ItemGroup>
<ItemGroup>
+ <ProjectReference Include="..\..\..\SideChains\ColorMine\ColorMine.csproj">
+ <Project>{37e4ceab-b54b-451f-b535-04cf7da9c459}</Project>
+ <Name>ColorMine</Name>
+ </ProjectReference>
<ProjectReference Include="..\..\..\SideChains\RealTimeGraphEx\RealTimeGraphEx.csproj">
<Project>{b9ae25d6-be35-492f-9079-21a7f3e6f7cc}</Project>
<Name>RealTimeGraphEx</Name>
</ProjectReference>
+ <ProjectReference Include="..\..\..\Tango.ColorPicker\Tango.ColorPicker.csproj">
+ <Project>{a2f5af44-29ff-45d6-9d25-ecda5cce88b5}</Project>
+ <Name>Tango.ColorPicker</Name>
+ </ProjectReference>
<ProjectReference Include="..\..\..\Tango.Core\Tango.Core.csproj">
<Project>{a34ee0f0-649d-41c8-8489-b6f1cc6924ee}</Project>
<Name>Tango.Core</Name>
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>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs
index 9eeff4975..c4e853433 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs
@@ -42,6 +42,9 @@ namespace Tango.MachineStudio.Developer.Views
{
_vm = DataContext as MainViewVM;
};
+
+ chkGraphs.Checked += (x, y) => { graphRowDefinition.Height = new GridLength(161, GridUnitType.Star); };
+ chkGraphs.Unchecked += (x, y) => { graphRowDefinition.Height = new GridLength(80, GridUnitType.Pixel); };
}
private void OnDropAvailableSensor(object sender, DropEventArgs e)