diff options
| author | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2019-09-16 11:40:14 +0300 |
|---|---|---|
| committer | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2019-09-16 11:40:14 +0300 |
| commit | b34d8641f72e7b92958ea17d10ff15c29d37c464 (patch) | |
| tree | 38f4740dd012b044d8c2737b21b8e1de58a836fb /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views | |
| parent | 1da774f550b3d26479087aa8da35220fc9e168d5 (diff) | |
| download | Tango-b34d8641f72e7b92958ea17d10ff15c29d37c464.tar.gz Tango-b34d8641f72e7b92958ea17d10ff15c29d37c464.zip | |
Dropping Machine Studio ColorLab Module. Move to RML module.
Related Work Items: #1168
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views')
8 files changed, 1192 insertions, 214 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/CalibrationDataView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/CalibrationDataView.xaml new file mode 100644 index 000000000..54e96017c --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/CalibrationDataView.xaml @@ -0,0 +1,72 @@ +<UserControl x:Class="Tango.MachineStudio.RML.Views.CalibrationDataView" + 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:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:vm="clr-namespace:Tango.MachineStudio.RML.ViewModels" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:local="clr-namespace:Tango.MachineStudio.RML.Views" + mc:Ignorable="d" + d:DesignHeight="450" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:CalibrationDataViewVM, IsDesignTimeCreatable=False}"> + + <UserControl.Resources> + <converters:ColorToIntegerConverter x:Key="ColorToIntegerConverter"></converters:ColorToIntegerConverter> + <converters:ColorComponentToOpacityConverter x:Key="ColorComponentToOpacityConverter" /> + <converters:ColorToComponentsConverter x:Key="ColorToComponentsConverter" /> + </UserControl.Resources> + + <Grid> + <ItemsControl DockPanel.Dock="Top" ItemsSource="{Binding LiquidsCalibrationData}" IsEnabled="{Binding IsFree}"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <UniformGrid Rows="1" /> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + + <ItemsControl.ItemTemplate> + <DataTemplate> + <DockPanel Width="240"> + + <StackPanel DockPanel.Dock="Top"> + + <StackPanel DockPanel.Dock="Right" VerticalAlignment="Bottom" HorizontalAlignment="Right" Orientation="Horizontal" Margin="0 0 5 0"> + <Button Style="{StaticResource MaterialDesignFlatButton}" Padding="0" ToolTip="Import from excel" Width="30" Command="{Binding RelativeSource={RelativeSource AncestorType=local:CalibrationDataView},Path=DataContext.ImportExcelCommand}" CommandParameter="{Binding}"> + <materialDesign:PackIcon Kind="Download" Foreground="{StaticResource BlackForegroundBrush}" /> + </Button> + <Button Style="{StaticResource MaterialDesignFlatButton}" Padding="0" ToolTip="Export to excel" Width="30" Command="{Binding RelativeSource={RelativeSource AncestorType=local:CalibrationDataView},Path=DataContext.ExportExcelCommand}" CommandParameter="{Binding}"> + <materialDesign:PackIcon Kind="Upload" Foreground="{StaticResource BlackForegroundBrush}" /> + </Button> + </StackPanel> + <Border Padding="2" Margin="5" CornerRadius="3"> + <Border.Background> + <SolidColorBrush Opacity="0.4" Color="{Binding LiquidType.Color,Converter={StaticResource ColorToIntegerConverter}}"></SolidColorBrush> + </Border.Background> + <TextBlock Text="{Binding LiquidType.Name}" HorizontalAlignment="Center" Foreground="{StaticResource MainWindow.Foreground}"></TextBlock> + </Border> + </StackPanel> + + <Grid Margin="0 0 0 5"> + <DataGrid Background="{StaticResource TransparentBackgroundBrush400}" AlternatingRowBackground="{StaticResource Transparent200}" BorderThickness="1" BorderBrush="{StaticResource DarkGrayBrush}" Margin="5 0" ItemsSource="{Binding CalibrationPoints}" CanUserResizeColumns="False" CanUserReorderColumns="False" AutoGenerateColumns="False" CanUserAddRows="True" CanUserDeleteRows="True" CanUserSortColumns="False"> + <DataGrid.CellStyle> + <Style TargetType="DataGridCell" BasedOn="{StaticResource {x:Type DataGridCell}}"> + <Setter Property="BorderThickness" Value="0"/> + <Setter Property="HorizontalContentAlignment" Value="Left"></Setter> + <Setter Property="FlowDirection" Value="RightToLeft"></Setter> + <Setter Property="Foreground" Value="{StaticResource BlackForegroundBrush}"></Setter> + </Style> + </DataGrid.CellStyle> + <DataGrid.Columns> + <DataGridTextColumn Header="#" Binding="{Binding Index}" Width="Auto" IsReadOnly="True" Foreground="{StaticResource DimGrayBrush}" FontSize="11" /> + <mahapps:DataGridNumericUpDownColumn Header="X" Binding="{Binding X}" Minimum="0" Maximum="10000" HideUpDownButtons="True" Width="1*"/> + <mahapps:DataGridNumericUpDownColumn Header="Y" Binding="{Binding Y}" Minimum="0" Maximum="10000" HideUpDownButtons="True" Width="1*" /> + </DataGrid.Columns> + </DataGrid> + </Grid> + </DockPanel> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/CalibrationDataView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/CalibrationDataView.xaml.cs new file mode 100644 index 000000000..e23e343a4 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/CalibrationDataView.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.RML.Views +{ + /// <summary> + /// Interaction logic for CalibrationDataView.xaml + /// </summary> + public partial class CalibrationDataView : UserControl + { + public CalibrationDataView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/ColorConversionView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/ColorConversionView.xaml new file mode 100644 index 000000000..ed27c1760 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/ColorConversionView.xaml @@ -0,0 +1,772 @@ +<UserControl x:Class="Tango.MachineStudio.RML.Views.ColorConversionView" + 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:local="clr-namespace:Tango.MachineStudio.RML.Views" + xmlns:vm="clr-namespace:Tango.MachineStudio.RML.ViewModels" + xmlns:global="clr-namespace:Tango.MachineStudio.RML" + xmlns:observables="clr-namespace:Tango.BL.Entities;assembly=Tango.BL" + xmlns:shapes="clr-namespace:Tango.SharedUI.Shapes;assembly=Tango.SharedUI" + xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" + xmlns:editors="clr-namespace:Tango.SharedUI.Editors;assembly=Tango.SharedUI" + xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:hive="clr-namespace:Tango.Hive;assembly=Tango.Hive" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:brushPicker="clr-namespace:Tango.BrushPicker;assembly=Tango.BrushPicker" + xmlns:colorConversion="clr-namespace:Tango.ColorConversion;assembly=Tango.ColorConversion" + 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}"> + <UserControl.Resources> + <converters:ColorToIntegerConverter x:Key="ColorToIntegerConverter"></converters:ColorToIntegerConverter> + <converters:ColorComponentToOpacityConverter x:Key="ColorComponentToOpacityConverter" /> + <converters:ColorToComponentsConverter x:Key="ColorToComponentsConverter" /> + <converters:NullObjectToBooleanConverter x:Key="NullObjectToBooleanConverter" /> + <converters:ObjectToObjectTypeConverter x:Key="ObjectToObjectTypeConverter" /> + <converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" /> + <converters:BooleanInverseConverter x:Key="BooleanInverseConverter" /> + <converters:BooleanToVisibilityInverseConverter x:Key="BooleanToVisibilityInverseConverter" /> + </UserControl.Resources> + <Grid> + <DockPanel> + <Border DockPanel.Dock="Top" Background="{StaticResource TransparentBackgroundBrush200}" Margin="20 0" Padding="5" CornerRadius="5"> + <Border.Effect> + <DropShadowEffect Opacity="0.4" /> + </Border.Effect> + <Grid> + <TextBlock HorizontalAlignment="Left" Margin="20 0 0 0" FontSize="16">COLOR CONVERSION</TextBlock> + </Grid> + </Border> + <Grid DockPanel.Dock="Top" x:Name="ColorCalibrationGrid" Margin="80,20,20,20"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="250" /> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="1*" /> + </Grid.ColumnDefinitions> + <Grid.RowDefinitions> + <RowDefinition Height="20" /> + <RowDefinition/> + <RowDefinition Height="30" /> + <RowDefinition Height="Auto" /> + </Grid.RowDefinitions> + <Grid.Resources> + <Style TargetType="TextBlock" > + <Setter Property="Foreground" Value="{StaticResource JobFieldForeground}"/> + </Style> + </Grid.Resources> + + <Grid Grid.Row="1"> + + <StackPanel Orientation="Vertical" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="-60 35 0 0"> + <RadioButton IsChecked="{Binding SourceColor.IsLab,Converter={StaticResource BooleanInverseConverter}}">RGB</RadioButton> + <RadioButton Margin="0 10 0 0" IsChecked="{Binding SourceColor.IsLab}">LAB</RadioButton> + </StackPanel> + + <StackPanel VerticalAlignment="Center"> + <StackPanel Height="20"> + <StackPanel Orientation="Horizontal" Margin="0 0 0 5" Visibility="{Binding IsOutOfGamut,Converter={StaticResource BooleanToVisibilityConverter}}"> + <materialDesign:PackIcon Kind="Alert" Foreground="{StaticResource RedBrush100}" /> + <TextBlock Margin="5 0 0 0" Foreground="{StaticResource RedBrush100}">Color is out of gamut</TextBlock> + </StackPanel> + </StackPanel> + <Border BorderThickness="1" BorderBrush="#545454" Margin="0" Padding="2 2 2 0"> + <brushPicker:BrushPicker x:Name="picker" Color="{Binding SourceColor.Color,Mode=TwoWay}" Background="Transparent" BorderThickness="0" Height="150" BrushTypeVisibility="Collapsed"></brushPicker:BrushPicker> + </Border> + + <Grid> + <ContentControl> + <ContentControl.Style> + <Style TargetType="ContentControl"> + <Setter Property="Content"> + <Setter.Value> + <StackPanel> + <DockPanel Margin="0 10 0 0"> + <TextBlock DockPanel.Dock="Left" Text="R" VerticalAlignment="Center" /> + <mahapps:NumericUpDown DockPanel.Dock="Right" HideUpDownButtons="True" StringFormat="0" Background="Transparent" BorderThickness="0" HorizontalContentAlignment="Center" Minimum="0" Maximum="255" Width="30" Value="{Binding SourceColor.Red}"></mahapps:NumericUpDown> + <Slider Margin="10 0" IsSnapToTickEnabled="True" TickFrequency="1" Maximum="255" Value="{Binding SourceColor.Red,Mode=TwoWay}"></Slider> + </DockPanel> + <DockPanel Margin="0 10 0 0"> + <TextBlock DockPanel.Dock="Left" Text="G" VerticalAlignment="Center" /> + <mahapps:NumericUpDown DockPanel.Dock="Right" HideUpDownButtons="True" StringFormat="0" Background="Transparent" BorderThickness="0" HorizontalContentAlignment="Center" Minimum="0" Maximum="255" Width="30" Value="{Binding SourceColor.Green}"></mahapps:NumericUpDown> + <Slider Margin="10 0" IsSnapToTickEnabled="True" TickFrequency="1" Maximum="255" Value="{Binding SourceColor.Green,Mode=TwoWay}"></Slider> + </DockPanel> + <DockPanel Margin="0 10 0 0"> + <TextBlock DockPanel.Dock="Left" Text="B" VerticalAlignment="Center" /> + <mahapps:NumericUpDown DockPanel.Dock="Right" HideUpDownButtons="True" StringFormat="0" Background="Transparent" BorderThickness="0" HorizontalContentAlignment="Center" Minimum="0" Maximum="255" Width="30" Value="{Binding SourceColor.Blue}"></mahapps:NumericUpDown> + <Slider Margin="10 0" IsSnapToTickEnabled="True" TickFrequency="1" Maximum="255" Value="{Binding SourceColor.Blue,Mode=TwoWay}"></Slider> + </DockPanel> + </StackPanel> + </Setter.Value> + </Setter> + + <Style.Triggers> + <DataTrigger Binding="{Binding SourceColor.IsLab}" Value="True"> + <Setter Property="Content"> + <Setter.Value> + <StackPanel> + <DockPanel Margin="0 10 0 0"> + <TextBlock DockPanel.Dock="Left" Text="L" VerticalAlignment="Center" /> + <mahapps:NumericUpDown DockPanel.Dock="Right" HideUpDownButtons="True" StringFormat="0.00" Background="Transparent" BorderThickness="0" HorizontalContentAlignment="Center" Minimum="0" Maximum="100" Width="30" Value="{Binding SourceColor.L}"></mahapps:NumericUpDown> + <Slider Margin="10 0" IsSnapToTickEnabled="True" TickFrequency="1" Minimum="0" Maximum="100" Value="{Binding SourceColor.L,Mode=TwoWay}"></Slider> + </DockPanel> + <DockPanel Margin="0 10 0 0"> + <TextBlock DockPanel.Dock="Left" Text="A" VerticalAlignment="Center" /> + <mahapps:NumericUpDown DockPanel.Dock="Right" HideUpDownButtons="True" StringFormat="0.00" Background="Transparent" BorderThickness="0" HorizontalContentAlignment="Center" Minimum="-128" Maximum="128" Width="30" Value="{Binding SourceColor.A}"></mahapps:NumericUpDown> + <Slider Margin="10 0" IsSnapToTickEnabled="True" TickFrequency="1" Minimum="-128" Maximum="128" Value="{Binding SourceColor.A,Mode=TwoWay}"></Slider> + </DockPanel> + <DockPanel Margin="0 10 0 0"> + <TextBlock DockPanel.Dock="Left" Text="B" VerticalAlignment="Center" /> + <mahapps:NumericUpDown DockPanel.Dock="Right" HideUpDownButtons="True" StringFormat="0.00" Background="Transparent" BorderThickness="0" HorizontalContentAlignment="Center" Minimum="-128" Maximum="128" Width="30" Value="{Binding SourceColor.B}"></mahapps:NumericUpDown> + <Slider Margin="10 0" IsSnapToTickEnabled="True" TickFrequency="1" Minimum="-128" Maximum="128" Value="{Binding SourceColor.B,Mode=TwoWay}"></Slider> + </DockPanel> + </StackPanel> + </Setter.Value> + </Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </ContentControl.Style> + </ContentControl> + </Grid> + </StackPanel> + </Grid> + + <TextBlock FontStyle="Italic" HorizontalAlignment="Center">SOURCE / INVERSE</TextBlock> + <TextBlock FontStyle="Italic" HorizontalAlignment="Center" Grid.Column="2" Margin="0 0 0 0">SUGGESTIONS</TextBlock> + <TextBlock FontStyle="Italic" HorizontalAlignment="Center" Grid.Column="4" Margin="-80 0 0 0">LIQUID VOLUMES</TextBlock> + + <Image Source="../Images/arrow-long-right.png" Grid.Column="1" Grid.Row="1" Width="120" Stretch="Fill" Height="30" Opacity="0.8" Margin="20 0 20 0"></Image> + + <hive:HexList Width="220" Height="270" UseHexItemHasContainer="True" Grid.Column="2" Grid.Row="1" RowCount="6" ColumnCount="5" ItemsSource="{Binding HiveSuggestions}" SelectedItem="{Binding SelectedSuggestion,Mode=TwoWay}"> + <hive:HexList.ItemContainerStyle> + <Style TargetType="hive:HexItem" BasedOn="{StaticResource {x:Type hive:HexItem}}"> + <Setter Property="Background" Value="{Binding Brush}"></Setter> + <Setter Property="Grid.Column" Value="0"></Setter> + <Setter Property="Grid.Row" Value="0"></Setter> + <Setter Property="Background" Value="Transparent"></Setter> + <Setter Property="BorderThickness" Value="1"></Setter> + + <Style.Triggers> + <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self},Path=DataContext,Converter={StaticResource ObjectToObjectTypeConverter}}" Value="{x:Type colorConversion:ColorConversionSuggestion}"> + <Setter Property="Grid.Column" Value="{Binding Column}"></Setter> + <Setter Property="Grid.Row" Value="{Binding Row}"></Setter> + <Setter Property="Background" Value="{Binding Brush}"></Setter> + </DataTrigger> + <Trigger Property="IsSelected" Value="True"> + <Setter Property="BorderThickness" Value="2"></Setter> + </Trigger> + </Style.Triggers> + </Style> + </hive:HexList.ItemContainerStyle> + + <hive:HexList.ItemTemplate> + <DataTemplate> + <TextBlock Foreground="{StaticResource WhiteTextBrush}"> + <Run Text="{Binding Row}"></Run><Run>,</Run> + <Run Text="{Binding Column}"/> + </TextBlock> + </DataTemplate> + </hive:HexList.ItemTemplate> + </hive:HexList> + + <TextBlock FontSize="40" Foreground="{StaticResource RedBrush100}" VerticalAlignment="Center" HorizontalAlignment="Center" Grid.Column="2" Grid.Row="1" Text="NO INPUT"> + <TextBlock.Style> + <Style TargetType="TextBlock"> + <Setter Property="Visibility" Value="Collapsed"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding HiveSuggestions.Count}" Value="0"> + <Setter Property="Visibility" Value="Visible"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </TextBlock.Style> + </TextBlock> + + <Image Source="../Images/arrow-long-right.png" Grid.Column="3" Grid.Row="1" Width="120" Stretch="Fill" Height="30" Opacity="0.8" Margin="20 0 20 0"></Image> + + <Grid Grid.Column="4" Grid.Row="1" IsHitTestVisible="False"> + <StackPanel HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0 -20 0 0"> + <StackPanel Orientation="Horizontal" Height="60"> + <DockPanel Width="50" HorizontalAlignment="Left" Margin="0 0 5 0"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">R</TextBlock> + + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="#202020"> + <Rectangle.Fill> + <SolidColorBrush Color="Red" Opacity="{Binding SelectedSuggestion.Coordinates.Red,Converter={StaticResource ColorComponentToOpacityConverter}}" /> + </Rectangle.Fill> + </Rectangle> + <TextBlock Text="{Binding SelectedSuggestion.Coordinates.Red}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> + </Grid> + </DockPanel> + <DockPanel Width="50" HorizontalAlignment="Left" Margin="0 0 5 0"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">G</TextBlock> + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="#202020"> + <Rectangle.Fill> + <SolidColorBrush Color="Green" Opacity="{Binding SelectedSuggestion.Coordinates.Green,Converter={StaticResource ColorComponentToOpacityConverter}}" /> + </Rectangle.Fill> + </Rectangle> + <TextBlock Text="{Binding SelectedSuggestion.Coordinates.Green}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> + </Grid> + </DockPanel> + <DockPanel Width="50" HorizontalAlignment="Left"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">B</TextBlock> + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="#202020"> + <Rectangle.Fill> + <SolidColorBrush Color="Blue" Opacity="{Binding SelectedSuggestion.Coordinates.Blue,Converter={StaticResource ColorComponentToOpacityConverter}}" /> + </Rectangle.Fill> + </Rectangle> + <TextBlock Text="{Binding SelectedSuggestion.Coordinates.Blue}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> + </Grid> + </DockPanel> + </StackPanel> + <StackPanel Orientation="Horizontal" Height="40" Margin="0 5 0 0"> + <DockPanel Width="50" HorizontalAlignment="Left" Margin="0 0 5 0"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">L</TextBlock> + + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="#202020"/> + <TextBlock Text="{Binding SelectedSuggestion.Coordinates.L,StringFormat='0.00'}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> + </Grid> + </DockPanel> + <DockPanel Width="50" HorizontalAlignment="Left" Margin="0 0 5 0"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">A</TextBlock> + + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="#202020"/> + <TextBlock Text="{Binding SelectedSuggestion.Coordinates.A,StringFormat='0.00'}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> + </Grid> + </DockPanel> + <DockPanel Width="50" HorizontalAlignment="Left"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">B</TextBlock> + + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="#202020"/> + <TextBlock Text="{Binding SelectedSuggestion.Coordinates.B,StringFormat='0.00'}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> + </Grid> + </DockPanel> + </StackPanel> + </StackPanel> + + <ItemsControl ItemsSource="{Binding LiquidVolumes}" VerticalAlignment="Center" MinWidth="420" > + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <StackPanel VerticalAlignment="Center" Orientation="Horizontal" IsItemsHost="True"></StackPanel> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + <ItemsControl.ItemTemplate> + <DataTemplate> + <StackPanel> + <TextBlock HorizontalAlignment="Center" TextAlignment="Center" Text="{Binding Name}" FontSize="10" Margin="0 0 0 5"></TextBlock> + <ContentControl Focusable="False" Style="{StaticResource numberBorder}" Width="60" Height="60" Margin="10 0 0 0"> + <ContentControl.Foreground> + <SolidColorBrush Color="{Binding Color,Converter={StaticResource ColorToIntegerConverter}}"></SolidColorBrush> + </ContentControl.Foreground> + <mahapps:NumericUpDown FontSize="16" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Volume, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.00" HideUpDownButtons="True" Minimum="0" Maximum="1000" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> + <!--<mahapps:NumericUpDown.Resources> + <StaticResource ResourceKey="SelectAllTextBoxResource"></StaticResource> + </mahapps:NumericUpDown.Resources>--> + </mahapps:NumericUpDown> + </ContentControl> + </StackPanel> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + <Image Source="../Images/arrow-long-down.png" Grid.Column="1" Grid.Row="1" Margin="0 0 10 -170" Height="70" Width="40" Opacity="0.8" Stretch="Fill" HorizontalAlignment="Right" ></Image> + + <TextBlock FontSize="14" FontWeight="SemiBold" FontStyle="Italic" VerticalAlignment="Bottom" HorizontalAlignment="Center" Margin="0 0 0 15"> + <Run>GAMUT REGION:</Run> + <Run Text="{Binding SelectedSuggestion.ProcessParametersTableIndex,Mode=OneWay}"></Run> + </TextBlock> + </Grid> + + + <StackPanel Grid.Column="4" Grid.Row="3"> + <StackPanel Height="25" Margin="25 0 0 0"> + <StackPanel Orientation="Horizontal" Margin="0 0 0 0" Visibility="{Binding IsVolumesOutOfRange,Converter={StaticResource BooleanToVisibilityConverter}}"> + <materialDesign:PackIcon Kind="Alert" Foreground="{StaticResource RedBrush100}" /> + <TextBlock Margin="5 0 0 0" Foreground="{StaticResource RedBrush100}">Liquid volumes exceeds the maximum range</TextBlock> + </StackPanel> + </StackPanel> + + <ItemsControl ItemsSource="{Binding LiquidVolumes}" VerticalAlignment="Center" MinWidth="420" IsEnabled="{Binding IsFree}"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <StackPanel VerticalAlignment="Center" Orientation="Horizontal" IsItemsHost="True"></StackPanel> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + <ItemsControl.ItemTemplate> + <DataTemplate> + <StackPanel> + <TextBlock HorizontalAlignment="Center" TextAlignment="Center" Text="{Binding Name}" FontSize="10" Margin="0 0 0 5"></TextBlock> + <ContentControl Focusable="False" Style="{StaticResource numberBorder}" Width="60" Height="60" Margin="10 0 0 0"> + <ContentControl.Foreground> + <SolidColorBrush Color="{Binding Color,Converter={StaticResource ColorToIntegerConverter}}"></SolidColorBrush> + </ContentControl.Foreground> + <mahapps:NumericUpDown FontSize="16" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Volume, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.00" HideUpDownButtons="True" Minimum="0" Maximum="1000" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> + <!--<mahapps:NumericUpDown.Resources> + <StaticResource ResourceKey="SelectAllTextBoxResource"></StaticResource> + </mahapps:NumericUpDown.Resources>--> + </mahapps:NumericUpDown> + </ContentControl> + </StackPanel> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + </StackPanel> + + + <Image Source="../Images/arrow-long-Left.png" Grid.Column="2" Grid.Row="3" Width="140" Stretch="Fill" Height="30" Opacity="0.8"></Image> + + <Border BorderBrush="{StaticResource borderBrush}" Grid.Row="3"> + <Grid> + <DockPanel Width="80" HorizontalAlignment="Left"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">COMPOSITE</TextBlock> + <Grid> + <Ellipse Height="70" Margin="0 5 0 0" Stroke="{StaticResource DarkGrayBrush}"> + <Ellipse.Fill> + <SolidColorBrush Color="{Binding TargetColor.Color}"></SolidColorBrush> + </Ellipse.Fill> + </Ellipse> + <materialDesign:PackIcon Visibility="{Binding IsVolumesOutOfRange,Converter={StaticResource BooleanToVisibilityConverter}}" Kind="Alert" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" Width="24" Height="24" /> + </Grid> + </DockPanel> + + <StackPanel HorizontalAlignment="Right"> + <StackPanel Orientation="Horizontal" Height="60"> + <DockPanel Width="50" HorizontalAlignment="Left" Margin="0 0 5 0"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">R</TextBlock> + + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="{StaticResource DarkGrayBrush}"> + <Rectangle.Fill> + <SolidColorBrush Color="Red" Opacity="{Binding TargetColor.Red,Converter={StaticResource ColorComponentToOpacityConverter}}" /> + </Rectangle.Fill> + </Rectangle> + <TextBlock Text="{Binding TargetColor.Red}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> + </Grid> + </DockPanel> + <DockPanel Width="50" HorizontalAlignment="Left" Margin="0 0 5 0"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">G</TextBlock> + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="{StaticResource DarkGrayBrush}"> + <Rectangle.Fill> + <SolidColorBrush Color="Green" Opacity="{Binding TargetColor.Green,Converter={StaticResource ColorComponentToOpacityConverter}}" /> + </Rectangle.Fill> + </Rectangle> + <TextBlock Text="{Binding TargetColor.Green}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> + </Grid> + </DockPanel> + <DockPanel Width="50" HorizontalAlignment="Left"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">B</TextBlock> + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="{StaticResource DarkGrayBrush}"> + <Rectangle.Fill> + <SolidColorBrush Color="Blue" Opacity="{Binding TargetColor.Blue,Converter={StaticResource ColorComponentToOpacityConverter}}" /> + </Rectangle.Fill> + </Rectangle> + <TextBlock Text="{Binding TargetColor.Blue}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> + </Grid> + </DockPanel> + </StackPanel> + <StackPanel Orientation="Horizontal" Height="40" Margin="0 5 0 0"> + <DockPanel Width="50" HorizontalAlignment="Left" Margin="0 0 5 0"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">L</TextBlock> + + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="{StaticResource DarkGrayBrush}"/> + <TextBlock Text="{Binding TargetColor.L,StringFormat='0.00'}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{StaticResource BlackForegroundBrush}"></TextBlock> + </Grid> + </DockPanel> + <DockPanel Width="50" HorizontalAlignment="Left" Margin="0 0 5 0"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">A</TextBlock> + + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="{StaticResource DarkGrayBrush}"/> + <TextBlock Text="{Binding TargetColor.A,StringFormat='0.00'}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{StaticResource BlackForegroundBrush}"></TextBlock> + </Grid> + </DockPanel> + <DockPanel Width="50" HorizontalAlignment="Left"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">B</TextBlock> + + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="{StaticResource DarkGrayBrush}"/> + <TextBlock Text="{Binding TargetColor.B,StringFormat='0.00'}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{StaticResource BlackForegroundBrush}"></TextBlock> + </Grid> + </DockPanel> + </StackPanel> + </StackPanel> + </Grid> + </Border> + </Grid> + + <!--<Grid Margin="80,20,20,20" DockPanel.Dock="Top" x:Name="ColorCalibrationGrid"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="250" /> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="1*" /> + </Grid.ColumnDefinitions> + <Grid.RowDefinitions> + <RowDefinition Height="20" /> + <RowDefinition /> + <RowDefinition Height="30" /> + <RowDefinition Height="Auto" /> + </Grid.RowDefinitions> + <Grid.Resources> + <Style TargetType="TextBlock" > + <Setter Property="Foreground" Value="{StaticResource JobFieldForeground}"/> + </Style> + </Grid.Resources> + + <Grid Grid.Row="1"> + + <StackPanel Orientation="Vertical" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="-70 15 0 0"> + <RadioButton IsChecked="{Binding SourceColor.IsLab,Converter={StaticResource BooleanInverseConverter}}">RGB</RadioButton> + <RadioButton Margin="0 10 0 0" IsChecked="{Binding SourceColor.IsLab}">LAB</RadioButton> + </StackPanel> + + <StackPanel VerticalAlignment="Center"> + <StackPanel Height="20"> + <StackPanel Orientation="Horizontal" Margin="0 0 0 5" Visibility="{Binding IsOutOfGamut,Converter={StaticResource BooleanToVisibilityConverter}}"> + <materialDesign:PackIcon Kind="Alert" Foreground="{StaticResource RedBrush100}" /> + <TextBlock Margin="5 0 0 0" Foreground="{StaticResource RedBrush100}">Color is out of gamut</TextBlock> + </StackPanel> + </StackPanel> + <Border BorderThickness="1" BorderBrush="#545454" Margin="0" Padding="2 2 2 0"> + <brushPicker:BrushPicker x:Name="picker" Color="{Binding SourceColor.Color,Mode=TwoWay}" Background="Transparent" BorderThickness="0" Height="150" BrushTypeVisibility="Collapsed"></brushPicker:BrushPicker> + </Border> + + <Grid> + <ContentControl> + <ContentControl.Style> + <Style TargetType="ContentControl"> + <Setter Property="Content"> + <Setter.Value> + <StackPanel> + <DockPanel Margin="0 10 0 0"> + <TextBlock DockPanel.Dock="Left" Text="R" VerticalAlignment="Center" /> + <mahapps:NumericUpDown DockPanel.Dock="Right" HideUpDownButtons="True" StringFormat="0" Background="Transparent" BorderThickness="0" HorizontalContentAlignment="Center" Minimum="0" Maximum="255" Width="30" Value="{Binding SourceColor.Red}"></mahapps:NumericUpDown> + <Slider Margin="10 0" IsSnapToTickEnabled="True" TickFrequency="1" Maximum="255" Value="{Binding SourceColor.Red,Mode=TwoWay}"></Slider> + </DockPanel> + <DockPanel Margin="0 10 0 0"> + <TextBlock DockPanel.Dock="Left" Text="G" VerticalAlignment="Center" /> + <mahapps:NumericUpDown DockPanel.Dock="Right" HideUpDownButtons="True" StringFormat="0" Background="Transparent" BorderThickness="0" HorizontalContentAlignment="Center" Minimum="0" Maximum="255" Width="30" Value="{Binding SourceColor.Green}"></mahapps:NumericUpDown> + <Slider Margin="10 0" IsSnapToTickEnabled="True" TickFrequency="1" Maximum="255" Value="{Binding SourceColor.Green,Mode=TwoWay}"></Slider> + </DockPanel> + <DockPanel Margin="0 10 0 0"> + <TextBlock DockPanel.Dock="Left" Text="B" VerticalAlignment="Center" /> + <mahapps:NumericUpDown DockPanel.Dock="Right" HideUpDownButtons="True" StringFormat="0" Background="Transparent" BorderThickness="0" HorizontalContentAlignment="Center" Minimum="0" Maximum="255" Width="30" Value="{Binding SourceColor.Blue}"></mahapps:NumericUpDown> + <Slider Margin="10 0" IsSnapToTickEnabled="True" TickFrequency="1" Maximum="255" Value="{Binding SourceColor.Blue,Mode=TwoWay}"></Slider> + </DockPanel> + </StackPanel> + </Setter.Value> + </Setter> + + <Style.Triggers> + <DataTrigger Binding="{Binding SourceColor.IsLab}" Value="True"> + <Setter Property="Content"> + <Setter.Value> + <StackPanel> + <DockPanel Margin="0 10 0 0"> + <TextBlock DockPanel.Dock="Left" Text="L" VerticalAlignment="Center" /> + <mahapps:NumericUpDown DockPanel.Dock="Right" HideUpDownButtons="True" StringFormat="0.00" Background="Transparent" BorderThickness="0" HorizontalContentAlignment="Center" Minimum="0" Maximum="100" Width="30" Value="{Binding SourceColor.L}"></mahapps:NumericUpDown> + <Slider Margin="10 0" IsSnapToTickEnabled="True" TickFrequency="1" Minimum="0" Maximum="100" Value="{Binding SourceColor.L,Mode=TwoWay}"></Slider> + </DockPanel> + <DockPanel Margin="0 10 0 0"> + <TextBlock DockPanel.Dock="Left" Text="A" VerticalAlignment="Center" /> + <mahapps:NumericUpDown DockPanel.Dock="Right" HideUpDownButtons="True" StringFormat="0.00" Background="Transparent" BorderThickness="0" HorizontalContentAlignment="Center" Minimum="-128" Maximum="128" Width="30" Value="{Binding SourceColor.A}"></mahapps:NumericUpDown> + <Slider Margin="10 0" IsSnapToTickEnabled="True" TickFrequency="1" Minimum="-128" Maximum="128" Value="{Binding SourceColor.A,Mode=TwoWay}"></Slider> + </DockPanel> + <DockPanel Margin="0 10 0 0"> + <TextBlock DockPanel.Dock="Left" Text="B" VerticalAlignment="Center" /> + <mahapps:NumericUpDown DockPanel.Dock="Right" HideUpDownButtons="True" StringFormat="0.00" Background="Transparent" BorderThickness="0" HorizontalContentAlignment="Center" Minimum="-128" Maximum="128" Width="30" Value="{Binding SourceColor.B}"></mahapps:NumericUpDown> + <Slider Margin="10 0" IsSnapToTickEnabled="True" TickFrequency="1" Minimum="-128" Maximum="128" Value="{Binding SourceColor.B,Mode=TwoWay}"></Slider> + </DockPanel> + </StackPanel> + </Setter.Value> + </Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </ContentControl.Style> + </ContentControl> + </Grid> + </StackPanel> + </Grid> + + <TextBlock FontStyle="Italic" HorizontalAlignment="Center" Grid.Column="0">SOURCE / INVERSE</TextBlock> + <TextBlock FontStyle="Italic" HorizontalAlignment="Center" Grid.Column="2" Margin="0 0 0 0">SUGGESTIONS</TextBlock> + <TextBlock FontStyle="Italic" HorizontalAlignment="Center" Grid.Column="4" Margin="-80 0 0 0">LIQUID VOLUMES</TextBlock> + + <Image Source="../Images/arrow-long-right.png" Grid.Column="1" Grid.Row="1" Width="100" Stretch="Fill" Height="30" Opacity="0.8" Margin="10 0 20 0"></Image> + + <hive:HexList Width="220" Height="270" UseHexItemHasContainer="True" Grid.Column="2" Grid.Row="1" RowCount="6" ColumnCount="5" ItemsSource="{Binding HiveSuggestions}" SelectedItem="{Binding SelectedSuggestion,Mode=TwoWay}"> + <hive:HexList.ItemContainerStyle> + <Style TargetType="hive:HexItem" BasedOn="{StaticResource {x:Type hive:HexItem}}"> + <Setter Property="Background" Value="{Binding Brush}"></Setter> + <Setter Property="Grid.Column" Value="0"></Setter> + <Setter Property="Grid.Row" Value="0"></Setter> + <Setter Property="Background" Value="Transparent"></Setter> + <Setter Property="BorderThickness" Value="1"></Setter> + + <Style.Triggers> + <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self},Path=DataContext,Converter={StaticResource ObjectToObjectTypeConverter}}" Value="{x:Type colorConversion:ColorConversionSuggestion}"> + <Setter Property="Grid.Column" Value="{Binding Column}"></Setter> + <Setter Property="Grid.Row" Value="{Binding Row}"></Setter> + <Setter Property="Background" Value="{Binding Brush}"></Setter> + </DataTrigger> + <Trigger Property="IsSelected" Value="True"> + <Setter Property="BorderThickness" Value="2"></Setter> + </Trigger> + </Style.Triggers> + </Style> + </hive:HexList.ItemContainerStyle> + + <hive:HexList.ItemTemplate> + <DataTemplate> + <TextBlock Foreground="{StaticResource WhiteTextBrush}"> + <Run Text="{Binding Row}"></Run><Run>,</Run> + <Run Text="{Binding Column}"/> + </TextBlock> + </DataTemplate> + </hive:HexList.ItemTemplate> + </hive:HexList> + + <TextBlock FontSize="40" Foreground="{StaticResource RedBrush100}" VerticalAlignment="Center" HorizontalAlignment="Center" Grid.Column="2" Grid.Row="1" Text="NO INPUT"> + <TextBlock.Style> + <Style TargetType="TextBlock"> + <Setter Property="Visibility" Value="Collapsed"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding HiveSuggestions.Count}" Value="0"> + <Setter Property="Visibility" Value="Visible"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </TextBlock.Style> + </TextBlock> + + <Image Source="../Images/arrow-long-right.png" Grid.Column="3" Grid.Row="1" Width="100" Stretch="Fill" Height="30" Opacity="0.8" Margin="10 0 20 0"></Image> + + <Grid Grid.Column="4" Grid.Row="1" IsHitTestVisible="False"> + <StackPanel HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0 0 0 0"> + <StackPanel Orientation="Horizontal" Height="50"> + <DockPanel Width="40" HorizontalAlignment="Left" Margin="0 0 5 0"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">R</TextBlock> + + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="#202020"> + <Rectangle.Fill> + <SolidColorBrush Color="Red" Opacity="{Binding SelectedSuggestion.Coordinates.Red,Converter={StaticResource ColorComponentToOpacityConverter}}" /> + </Rectangle.Fill> + </Rectangle> + <TextBlock Text="{Binding SelectedSuggestion.Coordinates.Red}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> + </Grid> + </DockPanel> + <DockPanel Width="40" HorizontalAlignment="Left" Margin="0 0 5 0"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">G</TextBlock> + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="#202020"> + <Rectangle.Fill> + <SolidColorBrush Color="Green" Opacity="{Binding SelectedSuggestion.Coordinates.Green,Converter={StaticResource ColorComponentToOpacityConverter}}" /> + </Rectangle.Fill> + </Rectangle> + <TextBlock Text="{Binding SelectedSuggestion.Coordinates.Green}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> + </Grid> + </DockPanel> + <DockPanel Width="40" HorizontalAlignment="Left"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">B</TextBlock> + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="#202020"> + <Rectangle.Fill> + <SolidColorBrush Color="Blue" Opacity="{Binding SelectedSuggestion.Coordinates.Blue,Converter={StaticResource ColorComponentToOpacityConverter}}" /> + </Rectangle.Fill> + </Rectangle> + <TextBlock Text="{Binding SelectedSuggestion.Coordinates.Blue}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> + </Grid> + </DockPanel> + </StackPanel> + <StackPanel Orientation="Horizontal" Height="40" Margin="0 5 0 0"> + <DockPanel Width="40" HorizontalAlignment="Left" Margin="0 0 5 0"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">L</TextBlock> + + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="#202020"/> + <TextBlock Text="{Binding SelectedSuggestion.Coordinates.L,StringFormat='0.00'}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> + </Grid> + </DockPanel> + <DockPanel Width="40" HorizontalAlignment="Left" Margin="0 0 5 0"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">A</TextBlock> + + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="#202020"/> + <TextBlock Text="{Binding SelectedSuggestion.Coordinates.A,StringFormat='0.00'}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> + </Grid> + </DockPanel> + <DockPanel Width="40" HorizontalAlignment="Left"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">B</TextBlock> + + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="#202020"/> + <TextBlock Text="{Binding SelectedSuggestion.Coordinates.B,StringFormat='0.00'}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> + </Grid> + </DockPanel> + </StackPanel> + </StackPanel> + + <ItemsControl ItemsSource="{Binding LiquidVolumes}" VerticalAlignment="Center" MinWidth="320" > + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <StackPanel VerticalAlignment="Center" Orientation="Horizontal" IsItemsHost="True"></StackPanel> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + <ItemsControl.ItemTemplate> + <DataTemplate> + <StackPanel> + <TextBlock HorizontalAlignment="Center" TextAlignment="Center" Text="{Binding Name}" FontSize="10" Margin="0 0 0 5"></TextBlock> + <ContentControl Focusable="False" Style="{StaticResource numberBorder}" Width="60" Height="60" Margin="10 0 0 0"> + <ContentControl.Foreground> + <SolidColorBrush Color="{Binding Color,Converter={StaticResource ColorToIntegerConverter}}"></SolidColorBrush> + </ContentControl.Foreground> + <mahapps:NumericUpDown FontSize="16" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Volume, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.00" HideUpDownButtons="True" Minimum="0" Maximum="1000" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> + + </mahapps:NumericUpDown> + </ContentControl> + </StackPanel> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + <Image Source="../Images/arrow-long-down.png" Grid.Column="1" Grid.Row="1" Margin="0 0 10 -170" Height="70" Width="40" Opacity="0.8" Stretch="Fill" HorizontalAlignment="Right" ></Image> + + <TextBlock FontSize="14" FontWeight="SemiBold" FontStyle="Italic" VerticalAlignment="Bottom" HorizontalAlignment="Center" Margin="0 0 0 15"> + <Run>GAMUT REGION:</Run> + <Run Text="{Binding SelectedSuggestion.ProcessParametersTableIndex,Mode=OneWay}"></Run> + </TextBlock> + </Grid> + + + <StackPanel Grid.Column="4" Grid.Row="3"> + <StackPanel Height="25" Margin="25 0 0 0"> + <StackPanel Orientation="Horizontal" Margin="0 0 0 0" Visibility="{Binding IsVolumesOutOfRange,Converter={StaticResource BooleanToVisibilityConverter}}"> + <materialDesign:PackIcon Kind="Alert" Foreground="{StaticResource RedBrush100}" /> + <TextBlock Margin="5 0 0 0" Foreground="{StaticResource RedBrush100}">Liquid volumes exceeds the maximum range</TextBlock> + </StackPanel> + </StackPanel> + + <ItemsControl ItemsSource="{Binding LiquidVolumes}" VerticalAlignment="Center" MinWidth="420" IsEnabled="{Binding IsFree}"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <StackPanel VerticalAlignment="Center" Orientation="Horizontal" IsItemsHost="True"></StackPanel> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + <ItemsControl.ItemTemplate> + <DataTemplate> + <StackPanel> + <TextBlock HorizontalAlignment="Center" TextAlignment="Center" Text="{Binding Name}" FontSize="10" Margin="0 0 0 5"></TextBlock> + <ContentControl Focusable="False" Style="{StaticResource numberBorder}" Width="60" Height="60" Margin="10 0 0 0"> + <ContentControl.Foreground> + <SolidColorBrush Color="{Binding Color,Converter={StaticResource ColorToIntegerConverter}}"></SolidColorBrush> + </ContentControl.Foreground> + <mahapps:NumericUpDown FontSize="16" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Volume, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.00" HideUpDownButtons="True" Minimum="0" Maximum="1000" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> + + </mahapps:NumericUpDown> + </ContentControl> + </StackPanel> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + </StackPanel> + + + <Image Source="../Images/arrow-long-Left.png" Grid.Column="2" Grid.Row="3" Width="120" Stretch="Fill" Height="30" Opacity="0.8"></Image> + + <Border BorderBrush="{StaticResource borderBrush}" Grid.Row="3"> + <Grid> + <DockPanel Width="80" HorizontalAlignment="Left"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">COMPOSITE</TextBlock> + <Grid> + <Ellipse Height="70" Margin="0 5 0 0" Stroke="{StaticResource DarkGrayBrush}"> + <Ellipse.Fill> + <SolidColorBrush Color="{Binding TargetColor.Color}"></SolidColorBrush> + </Ellipse.Fill> + </Ellipse> + <materialDesign:PackIcon Visibility="{Binding IsVolumesOutOfRange,Converter={StaticResource BooleanToVisibilityConverter}}" Kind="Alert" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" Width="24" Height="24" /> + </Grid> + </DockPanel> + + <StackPanel HorizontalAlignment="Right"> + <StackPanel Orientation="Horizontal" Height="60"> + <DockPanel Width="50" HorizontalAlignment="Left" Margin="0 0 5 0"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">R</TextBlock> + + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="{StaticResource DarkGrayBrush}"> + <Rectangle.Fill> + <SolidColorBrush Color="Red" Opacity="{Binding TargetColor.Red,Converter={StaticResource ColorComponentToOpacityConverter}}" /> + </Rectangle.Fill> + </Rectangle> + <TextBlock Text="{Binding TargetColor.Red}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> + </Grid> + </DockPanel> + <DockPanel Width="50" HorizontalAlignment="Left" Margin="0 0 5 0"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">G</TextBlock> + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="{StaticResource DarkGrayBrush}"> + <Rectangle.Fill> + <SolidColorBrush Color="Green" Opacity="{Binding TargetColor.Green,Converter={StaticResource ColorComponentToOpacityConverter}}" /> + </Rectangle.Fill> + </Rectangle> + <TextBlock Text="{Binding TargetColor.Green}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> + </Grid> + </DockPanel> + <DockPanel Width="50" HorizontalAlignment="Left"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">B</TextBlock> + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="{StaticResource DarkGrayBrush}"> + <Rectangle.Fill> + <SolidColorBrush Color="Blue" Opacity="{Binding TargetColor.Blue,Converter={StaticResource ColorComponentToOpacityConverter}}" /> + </Rectangle.Fill> + </Rectangle> + <TextBlock Text="{Binding TargetColor.Blue}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> + </Grid> + </DockPanel> + </StackPanel> + <StackPanel Orientation="Horizontal" Height="40" Margin="0 5 0 0"> + <DockPanel Width="50" HorizontalAlignment="Left" Margin="0 0 5 0"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">L</TextBlock> + + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="{StaticResource DarkGrayBrush}"/> + <TextBlock Text="{Binding TargetColor.L,StringFormat='0.00'}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{StaticResource BlackForegroundBrush}"></TextBlock> + </Grid> + </DockPanel> + <DockPanel Width="50" HorizontalAlignment="Left" Margin="0 0 5 0"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">A</TextBlock> + + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="{StaticResource DarkGrayBrush}"/> + <TextBlock Text="{Binding TargetColor.A,StringFormat='0.00'}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{StaticResource BlackForegroundBrush}"></TextBlock> + </Grid> + </DockPanel> + <DockPanel Width="50" HorizontalAlignment="Left"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">B</TextBlock> + + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="{StaticResource DarkGrayBrush}"/> + <TextBlock Text="{Binding TargetColor.B,StringFormat='0.00'}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{StaticResource BlackForegroundBrush}"></TextBlock> + </Grid> + </DockPanel> + </StackPanel> + </StackPanel> + </Grid> + </Border> + </Grid>--> + </DockPanel> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/ColorConversionView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/ColorConversionView.xaml.cs new file mode 100644 index 000000000..8b6955269 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/ColorConversionView.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.RML.Views +{ + /// <summary> + /// Interaction logic for ColorConversionView.xaml + /// </summary> + public partial class ColorConversionView : UserControl + { + public ColorConversionView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/ProcessParametersView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/ProcessParametersView.xaml new file mode 100644 index 000000000..b85fd2c12 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/ProcessParametersView.xaml @@ -0,0 +1,155 @@ +<UserControl x:Class="Tango.MachineStudio.RML.Views.ProcessParametersView" + 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:global="clr-namespace:Tango.MachineStudio.RML" + xmlns:observables="clr-namespace:Tango.BL.Entities;assembly=Tango.BL" + xmlns:shapes="clr-namespace:Tango.SharedUI.Shapes;assembly=Tango.SharedUI" + xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" + xmlns:editors="clr-namespace:Tango.SharedUI.Editors;assembly=Tango.SharedUI" + xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:dragAndDrop="clr-namespace:Tango.DragAndDrop;assembly=Tango.DragAndDrop" + xmlns:vm="clr-namespace:Tango.MachineStudio.RML.ViewModels" + xmlns:local="clr-namespace:Tango.MachineStudio.RML.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}"> + + <UserControl.Resources> + <converters:ColorToIntegerConverter x:Key="ColorToIntegerConverter"></converters:ColorToIntegerConverter> + </UserControl.Resources> + <Grid> + <Grid.RowDefinitions> + <RowDefinition Height="416*"/> + <RowDefinition Height="120"/> + </Grid.RowDefinitions> + <Grid Grid.Row="0"> + <DockPanel> + <Border DockPanel.Dock="Top" Background="{StaticResource TransparentBackgroundBrush200}" Margin="20 0" Padding="5" CornerRadius="5"> + <Border.Effect> + <DropShadowEffect Opacity="0.4" /> + </Border.Effect> + <Grid> + <TextBlock HorizontalAlignment="Left" Margin="20 0 0 0" FontSize="16">ACTIVE PROCESS GROUP</TextBlock> + <Button ToolTip="Add new table" Style="{StaticResource MaterialDesignFlatButton}" Height="Auto" Width="30" HorizontalAlignment="Right" Padding="0" Command="{Binding AddProcessParametersTableCommand}"> + <materialDesign:PackIcon Kind="Plus" Foreground="#0AC30A" Width="24" Height="24" /> + </Button> + </Grid> + </Border> + <Grid> + <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="0 20"> + <ItemsControl ItemsSource="{Binding ActiveProcessParametersTableView}"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <StackPanel HorizontalAlignment="Left" Orientation="Horizontal" /> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + <ItemsControl.ItemTemplate> + <DataTemplate> + <DockPanel> + <Button DockPanel.Dock="Right" Style="{StaticResource MaterialDesignFlatButton}" Padding="0" VerticalAlignment="Bottom" ToolTip="Remove table" Width="30" Margin="10 0 0 10" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.RemoveProcessParametersTableCommand}" CommandParameter="{Binding}"> + <materialDesign:PackIcon Kind="Delete" Width="24" Height="24" Foreground="#FF7D7D" /> + </Button> + + <Grid Style="{StaticResource draggableDroppableGrid}" dragAndDrop:DragAndDropService.Drop="OnProcessTableDropped"> + <Border Padding="5" BorderThickness="1" Margin="20 5 0 5" BorderBrush="{StaticResource DarkGrayBrush}" Background="{StaticResource TransparentBackgroundBrush100}"> + <Grid> + <DockPanel Width="300"> + <TextBox materialDesign:HintAssist.Hint="Table Name" DockPanel.Dock="Top" Text="{Binding Name}"></TextBox> + + <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" Padding="5"> + <editors:ParameterizedEditor ParameterizedObject="{Binding}"> + <editors:ParameterizedEditor.ItemsPanel> + <ItemsPanelTemplate> + <StackPanel IsItemsHost="True" /> + </ItemsPanelTemplate> + </editors:ParameterizedEditor.ItemsPanel> + <editors:ParameterizedEditor.DoubleTemplate> + <DataTemplate> + <DockPanel> + <TextBlock IsHitTestVisible="False" Margin="0 5 0 5" Text="{Binding Name}" FontSize="11"></TextBlock> + <mahapps:NumericUpDown HorizontalAlignment="Right" Minimum="0" Margin="0 0 5 0" HideUpDownButtons="True" HorizontalContentAlignment="Right" Maximum="10000" StringFormat="0.0" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" Value="{Binding Value,Mode=TwoWay}"></mahapps:NumericUpDown> + </DockPanel> + </DataTemplate> + </editors:ParameterizedEditor.DoubleTemplate> + </editors:ParameterizedEditor> + </ScrollViewer> + </DockPanel> + </Grid> + </Border> + + <dragAndDrop:DragThumb Background="Transparent" Cursor="SizeAll" ToolTip="Drag and drop" Margin="0 3 -1 0" HorizontalAlignment="Right" VerticalAlignment="Top"> + <materialDesign:PackIcon HorizontalAlignment="Right" VerticalAlignment="Top" IsHitTestVisible="False" Kind="Drag" Width="32" Height="32" Background="Transparent" /> + </dragAndDrop:DragThumb> + </Grid> + </DockPanel> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + </StackPanel> + + <dragAndDrop:DraggingSurface x:Name="draggingSurface" ClipToBounds="True" /> + </Grid> + </DockPanel> + </Grid> + <Grid Grid.Row="1"> + <DockPanel> + <Grid> + <Grid Margin="0 0 0 0"> + <DockPanel> + <Border DockPanel.Dock="Top" Background="{StaticResource TransparentBackgroundBrush200}" Margin="20 0" Padding="5" CornerRadius="5"> + <Border.Effect> + <DropShadowEffect Opacity="0.4" /> + </Border.Effect> + <Grid> + <TextBlock HorizontalAlignment="Left" Margin="20 0 0 0" FontSize="16">LIQUID FACTORS</TextBlock> + + <Button ToolTip="Add new liquid factor" HorizontalAlignment="Right" Style="{StaticResource MaterialDesignFlatButton}" Height="Auto" VerticalAlignment="Bottom" Width="30" Padding="0" Command="{Binding AddLiquidFactorCommand}"> + <materialDesign:PackIcon Kind="Plus" Foreground="#0AC30A" Width="24" Height="24" /> + </Button> + </Grid> + </Border> + <ScrollViewer x:Name="liquidsFactorsScrollViewer" VerticalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Hidden" Margin="15 0 20 0"> + <ItemsControl Width="{Binding WidthLilquidFactors, RelativeSource={RelativeSource AncestorType=UserControl}}" ItemsSource="{Binding LiquidTypesRmls}" Margin="0 10 0 0"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <UniformGrid IsItemsHost="True" Rows="1"></UniformGrid> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + <ItemsControl.ItemTemplate> + <DataTemplate DataType="{x:Type observables:LiquidTypesRml}"> + <Grid Margin="20 0 20 0" MaxWidth="230"> + + <Button HorizontalAlignment="Right" Style="{StaticResource MaterialDesignFlatButton}" Padding="0" ToolTip="Remove liquid factor" Width="30" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.RemoveLiquidFactorCommand}" CommandParameter="{Binding}"> + <materialDesign:PackIcon Kind="Delete" Foreground="#FF7D7D" /> + </Button> + + <StackPanel Margin="0 0 10 0"> + <TextBlock HorizontalAlignment="Center" FontSize="10" Foreground="{StaticResource MainWindow.Foreground}" Text="{Binding LiquidType.Name}"></TextBlock> + <Grid Width="58" Height="48" Margin="0 5 0 0"> + <shapes:Hexagon StrokeThickness="1" Stroke="Gray"> + <shapes:Hexagon.Fill> + <LinearGradientBrush Opacity="0.7" > + <GradientStop Color="{Binding LiquidType.Color,Converter={StaticResource ColorToIntegerConverter}}"/> + <GradientStop Color="White" Offset="1"/> + </LinearGradientBrush> + </shapes:Hexagon.Fill> + </shapes:Hexagon> + + <TextBox Style="{x:Null}" Background="Transparent" Foreground="{StaticResource Hexagon.ForegroundBrush}" BorderThickness="0" Text="{Binding MaxNlPerCm}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" FontStyle="Italic"></TextBox> + </Grid> + </StackPanel> + </Grid> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + </ScrollViewer> + </DockPanel> + </Grid> + </Grid> + </DockPanel> + </Grid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/ProcessParametersView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/ProcessParametersView.xaml.cs new file mode 100644 index 000000000..a6d03ca0e --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/ProcessParametersView.xaml.cs @@ -0,0 +1,59 @@ +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; +using Tango.MachineStudio.RML.ViewModels; +using Tango.BL.Entities; +using Tango.DragAndDrop; + +namespace Tango.MachineStudio.RML.Views +{ + /// <summary> + /// Interaction logic for ProcessParametersView.xaml + /// </summary> + public partial class ProcessParametersView : UserControl + { + private MainViewVM _vm; + public DraggingSurface DraggingSurface + { + get { return (DraggingSurface)GetValue(DraggingSurfaceProperty); } + set { SetValue(DraggingSurfaceProperty, value); } + } + public static readonly DependencyProperty DraggingSurfaceProperty = + DependencyProperty.Register("DraggingSurface", typeof(DraggingSurface), typeof(ProcessParametersView), new PropertyMetadata(null)); + + public double WidthLilquidFactors + { + get { return (double )GetValue(WidthLilquidFactorsProperty); } + set { SetValue(WidthLilquidFactorsProperty, value); } + } + + // Using a DependencyProperty as the backing store for WidthLilquidFactors. This enables animation, styling, binding, etc... + public static readonly DependencyProperty WidthLilquidFactorsProperty = + DependencyProperty.Register("WidthLilquidFactors", typeof(double ), typeof(ProcessParametersView), new PropertyMetadata(null)); + + + public ProcessParametersView() + { + InitializeComponent(); + DraggingSurface = draggingSurface; + Loaded += (_, __) => { _vm = DataContext as MainViewVM; }; + } + private void OnProcessTableDropped(object sender, DropEventArgs e) + { + ProcessParametersTable dragged = e.Draggable.DataContext as ProcessParametersTable; + ProcessParametersTable dropped = e.Droppable.DataContext as ProcessParametersTable; + _vm.OnProcessParametersTableDropped(dragged, dropped); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml index fa51a6bf5..628b9e402 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml @@ -9,7 +9,6 @@ xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" xmlns:editors="clr-namespace:Tango.SharedUI.Editors;assembly=Tango.SharedUI" xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" - xmlns:colorLabViews="clr-namespace:Tango.MachineStudio.ColorLab.Views;assembly=Tango.MachineStudio.ColorLab" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:dragAndDrop="clr-namespace:Tango.DragAndDrop;assembly=Tango.DragAndDrop" @@ -126,215 +125,94 @@ <Grid Grid.Column="2"> <Grid.RowDefinitions> - <RowDefinition Height="416*"/> - <RowDefinition Height="490"/> + <RowDefinition Height="536*"/> + <RowDefinition Height="370"/> </Grid.RowDefinitions> + <Grid Grid.Row="0" IsEnabled="{Binding IsFree}"> + <TabControl Background="Transparent" Margin="0,-70,0,0" x:Name="processTabControl" Padding="0 25 0 0"> + <TabControl.Resources> + <Style TargetType="TabPanel"> + <Setter Property="HorizontalAlignment" Value="Center"/> + </Style> + <Style TargetType="TabItem" BasedOn="{StaticResource {x:Type TabItem}}"> + <Setter Property="Padding" Value="20,2"></Setter> + </Style> + </TabControl.Resources> + <TabItem Header="PROCESS PARAMETERS" Margin="-100 0 0 0 "> + <local:ProcessParametersView x:Name="processParametersView" WidthLilquidFactors="{Binding ElementName=calibrationDataView,Path=ActualWidth}"/> + </TabItem> + <TabItem Header="COLOR CONVERSION" Margin="-100 0 0 0 "> + <Grid> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="*"></ColumnDefinition> + <ColumnDefinition Width="260"></ColumnDefinition> + </Grid.ColumnDefinitions> + <local:ColorConversionView x:Name="colorConversionView" Margin="0 0 0 0" Grid.Column="0" DataContext="{Binding ColorConversionViewVM}"/> + <DockPanel Grid.Column="1"> + <Border DockPanel.Dock="Top" Background="{StaticResource TransparentBackgroundBrush200}" Margin="16 0" Padding="5" CornerRadius="5"> + <Border.Effect> + <DropShadowEffect Opacity="0.4" /> + </Border.Effect> + <Grid> + <TextBlock HorizontalAlignment="Left" Margin="20 0 0 0" FontSize="16">CCT</TextBlock> + </Grid> + </Border> + <Grid DockPanel.Dock="Top" Background="#35B5B5B5" Margin="20 0"> + <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center"> + <Grid> + <StackPanel Orientation="Vertical" HorizontalAlignment="Left"> + <Image Source="../Images/data-table.png" Height="80" Opacity="0.8" ></Image> + <StackPanel VerticalAlignment="Center" Width="200" Margin="5 20 5 10"> - <Grid> - <Grid> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="1*" /> - <ColumnDefinition Width="510" /> - </Grid.ColumnDefinitions> - + <ComboBox materialDesign:HintAssist.Hint="No CCT Defined" Margin="0 5 0 0" HorizontalContentAlignment="Center" ItemsSource="{Binding CCTS}" SelectedItem="{Binding SelectedCCT}" DisplayMemberPath="FileName" Style="{StaticResource TransparentComboBoxStyle}"></ComboBox> + <UniformGrid Columns="2" Margin="0 5 0 0" HorizontalAlignment="Right"> + <Button Style="{StaticResource MaterialDesignFlatButton}" Padding="0" Command="{Binding ImportForwardDataCommand}"> + <StackPanel Orientation="Horizontal" Margin="0 0 20 0"> + <materialDesign:PackIcon Kind="Upload" VerticalAlignment="Center" /> + <TextBlock Margin="5 0 0 0">IMPORT</TextBlock> + </StackPanel> + </Button> + <Button Style="{StaticResource MaterialDesignFlatButton}" Padding="0" Command="{Binding ExportForwardDataCommand}"> + <StackPanel Orientation="Horizontal"> + <materialDesign:PackIcon Kind="Download" VerticalAlignment="Center" /> + <TextBlock Margin="5 0 0 0">EXPORT</TextBlock> + </StackPanel> + </Button> + </UniformGrid> + </StackPanel> + </StackPanel> + </Grid> + </StackPanel> + </Grid> + </DockPanel> + </Grid> + <!--<local:ColorConversionView x:Name="colorConversionView" />--> + </TabItem> + </TabControl> + </Grid> + <Grid Grid.Row="1"> + <Grid > <DockPanel> <Border DockPanel.Dock="Top" Background="{StaticResource TransparentBackgroundBrush200}" Margin="20 0" Padding="5" CornerRadius="5"> <Border.Effect> <DropShadowEffect Opacity="0.4" /> </Border.Effect> <Grid> - <TextBlock HorizontalAlignment="Left" Margin="20 0 0 0" FontSize="16">ACTIVE PROCESS GROUP</TextBlock> - <Button ToolTip="Add new table" Style="{StaticResource MaterialDesignFlatButton}" Height="Auto" Width="30" HorizontalAlignment="Right" Padding="0" Command="{Binding AddProcessParametersTableCommand}"> - <materialDesign:PackIcon Kind="Plus" Foreground="#0AC30A" Width="24" Height="24" /> + <TextBlock HorizontalAlignment="Left" Margin="20 0 0 0" FontSize="16">CALIBRATION DATA</TextBlock> + <Button ToolTip="Create excel file template" FontSize="11" Foreground="{StaticResource DarkGrayBrush200}" HorizontalAlignment="Right" Style="{StaticResource MaterialDesignFlatButton}" Height="Auto" VerticalAlignment="Bottom" Padding="0" Command="{Binding CreateCalibrationDataExcelTemplateCommand}" Margin="0 0 5 0"> + <StackPanel Orientation="Horizontal"> + <materialDesign:PackIcon Kind="FileExcel" Foreground="{StaticResource DimGrayBrush}" Width="16" Height="26" /> + <TextBlock VerticalAlignment="Center" Margin="5 0 0 0">Create Empty Excel Template</TextBlock> + </StackPanel> </Button> </Grid> </Border> - <Grid> - <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="0 20"> - <ItemsControl ItemsSource="{Binding ActiveProcessParametersTableView}"> - <ItemsControl.ItemsPanel> - <ItemsPanelTemplate> - <StackPanel HorizontalAlignment="Left" Orientation="Horizontal" /> - </ItemsPanelTemplate> - </ItemsControl.ItemsPanel> - <ItemsControl.ItemTemplate> - <DataTemplate> - <DockPanel> - <Button DockPanel.Dock="Right" Style="{StaticResource MaterialDesignFlatButton}" Padding="0" VerticalAlignment="Bottom" ToolTip="Remove table" Width="30" Margin="10 0 0 10" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.RemoveProcessParametersTableCommand}" CommandParameter="{Binding}"> - <materialDesign:PackIcon Kind="Delete" Width="24" Height="24" Foreground="#FF7D7D" /> - </Button> - <Grid Style="{StaticResource draggableDroppableGrid}" dragAndDrop:DragAndDropService.Drop="OnProcessTableDropped"> - <Border Padding="5" BorderThickness="1" Margin="20 5 0 5" BorderBrush="{StaticResource DarkGrayBrush}" Background="{StaticResource TransparentBackgroundBrush100}"> - <Grid> - <DockPanel Width="300"> - <TextBox materialDesign:HintAssist.Hint="Table Name" DockPanel.Dock="Top" Text="{Binding Name}"></TextBox> - - <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" Padding="5"> - <editors:ParameterizedEditor ParameterizedObject="{Binding}"> - <editors:ParameterizedEditor.ItemsPanel> - <ItemsPanelTemplate> - <StackPanel IsItemsHost="True" /> - </ItemsPanelTemplate> - </editors:ParameterizedEditor.ItemsPanel> - <editors:ParameterizedEditor.DoubleTemplate> - <DataTemplate> - <DockPanel> - <TextBlock IsHitTestVisible="False" Margin="0 5 0 5" Text="{Binding Name}" FontSize="11"></TextBlock> - <mahapps:NumericUpDown HorizontalAlignment="Right" Minimum="0" Margin="0 0 5 0" HideUpDownButtons="True" HorizontalContentAlignment="Right" Maximum="10000" StringFormat="0.0" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" Value="{Binding Value,Mode=TwoWay}"></mahapps:NumericUpDown> - </DockPanel> - </DataTemplate> - </editors:ParameterizedEditor.DoubleTemplate> - </editors:ParameterizedEditor> - </ScrollViewer> - </DockPanel> - </Grid> - </Border> - - <dragAndDrop:DragThumb Background="Transparent" Cursor="SizeAll" ToolTip="Drag and drop" Margin="0 3 -1 0" HorizontalAlignment="Right" VerticalAlignment="Top"> - <materialDesign:PackIcon HorizontalAlignment="Right" VerticalAlignment="Top" IsHitTestVisible="False" Kind="Drag" Width="32" Height="32" Background="Transparent" /> - </dragAndDrop:DragThumb> - </Grid> - </DockPanel> - </DataTemplate> - </ItemsControl.ItemTemplate> - </ItemsControl> - </StackPanel> - - <dragAndDrop:DraggingSurface x:Name="draggingSurface" ClipToBounds="True" /> - </Grid> - </DockPanel> - - <DockPanel Grid.Column="1"> - <Border DockPanel.Dock="Top" Background="{StaticResource TransparentBackgroundBrush200}" Margin="20 0" Padding="5" CornerRadius="5"> - <Border.Effect> - <DropShadowEffect Opacity="0.4" /> - </Border.Effect> - <Grid> - <TextBlock HorizontalAlignment="Left" Margin="20 0 0 0" FontSize="16">COLOR CONVERSION TABLE (CCT)</TextBlock> - </Grid> - </Border> - <Grid DockPanel.Dock="Top" Background="#35B5B5B5" Margin="24 0"> - <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center"> - <Grid> - <StackPanel Orientation="Horizontal"> - <materialDesign:PackIcon Kind="ArrowLeftBoldHexagonOutline" VerticalAlignment="Center" Width="40" Height="40" /> - <Image Source="../Images/data-table.png" Height="80" Opacity="0.8"></Image> - <StackPanel VerticalAlignment="Center" Width="300" Margin="10 0 0 0"> - - <ComboBox materialDesign:HintAssist.Hint="No CCT Defined" Margin="0 5 0 0" HorizontalContentAlignment="Center" ItemsSource="{Binding CCTS}" SelectedItem="{Binding SelectedCCT}" DisplayMemberPath="FileName" Style="{StaticResource TransparentComboBoxStyle}"></ComboBox> - <UniformGrid Columns="2" Margin="0 5 0 0" HorizontalAlignment="Right"> - <Button Style="{StaticResource MaterialDesignFlatButton}" Padding="0" Command="{Binding ImportForwardDataCommand}"> - <StackPanel Orientation="Horizontal" Margin="0 0 20 0"> - <materialDesign:PackIcon Kind="Upload" VerticalAlignment="Center" /> - <TextBlock Margin="5 0 0 0">IMPORT</TextBlock> - </StackPanel> - </Button> - <Button Style="{StaticResource MaterialDesignFlatButton}" Padding="0" Command="{Binding ExportForwardDataCommand}"> - <StackPanel Orientation="Horizontal"> - <materialDesign:PackIcon Kind="Download" VerticalAlignment="Center" /> - <TextBlock Margin="5 0 0 0">EXPORT</TextBlock> - </StackPanel> - </Button> - </UniformGrid> - </StackPanel> - </StackPanel> - </Grid> - </StackPanel> - </Grid> + <ScrollViewer x:Name="calibrationDataScrollViewer" ScrollChanged="calibrationDataScrollViewer_ScrollChanged" VerticalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Auto" Margin="15 0 20 0"> + <local:CalibrationDataView x:Name="calibrationDataView" Margin="0 10 0 0" DataContext="{Binding CalibrationDataViewVM}" /> + </ScrollViewer> </DockPanel> </Grid> - - </Grid> - - - <Grid Grid.Row="1"> - - <DockPanel> - - <Grid> - <Grid.RowDefinitions> - <RowDefinition Height="120"/> - <RowDefinition Height="1*"/> - </Grid.RowDefinitions> - <Grid Margin="0 0 0 0"> - <DockPanel> - <Border DockPanel.Dock="Top" Background="{StaticResource TransparentBackgroundBrush200}" Margin="20 0" Padding="5" CornerRadius="5"> - <Border.Effect> - <DropShadowEffect Opacity="0.4" /> - </Border.Effect> - <Grid> - <TextBlock HorizontalAlignment="Left" Margin="20 0 0 0" FontSize="16">LIQUID FACTORS</TextBlock> - - <Button ToolTip="Add new liquid factor" HorizontalAlignment="Right" Style="{StaticResource MaterialDesignFlatButton}" Height="Auto" VerticalAlignment="Bottom" Width="30" Padding="0" Command="{Binding AddLiquidFactorCommand}"> - <materialDesign:PackIcon Kind="Plus" Foreground="#0AC30A" Width="24" Height="24" /> - </Button> - </Grid> - </Border> - - <ScrollViewer x:Name="liquidsFactorsScrollViewer" VerticalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Hidden" Margin="15 0 20 0"> - <ItemsControl Width="{Binding ElementName=calibrationDataView,Path=ActualWidth}" ItemsSource="{Binding LiquidTypesRmls}" Margin="0 10 0 0"> - <ItemsControl.ItemsPanel> - <ItemsPanelTemplate> - <UniformGrid IsItemsHost="True" Rows="1"></UniformGrid> - </ItemsPanelTemplate> - </ItemsControl.ItemsPanel> - <ItemsControl.ItemTemplate> - <DataTemplate DataType="{x:Type observables:LiquidTypesRml}"> - <Grid Margin="20 0 20 0" MaxWidth="230"> - - <Button HorizontalAlignment="Right" Style="{StaticResource MaterialDesignFlatButton}" Padding="0" ToolTip="Remove liquid factor" Width="30" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.RemoveLiquidFactorCommand}" CommandParameter="{Binding}"> - <materialDesign:PackIcon Kind="Delete" Foreground="#FF7D7D" /> - </Button> - - <StackPanel Margin="0 0 10 0"> - <TextBlock HorizontalAlignment="Center" FontSize="10" Foreground="{StaticResource MainWindow.Foreground}" Text="{Binding LiquidType.Name}"></TextBlock> - <Grid Width="58" Height="48" Margin="0 5 0 0"> - <shapes:Hexagon StrokeThickness="1" Stroke="Gray"> - <shapes:Hexagon.Fill> - <LinearGradientBrush Opacity="0.7" > - <GradientStop Color="{Binding LiquidType.Color,Converter={StaticResource ColorToIntegerConverter}}"/> - <GradientStop Color="White" Offset="1"/> - </LinearGradientBrush> - </shapes:Hexagon.Fill> - </shapes:Hexagon> - - <TextBox Style="{x:Null}" Background="Transparent" Foreground="{StaticResource Hexagon.ForegroundBrush}" BorderThickness="0" Text="{Binding MaxNlPerCm}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" FontStyle="Italic"></TextBox> - </Grid> - </StackPanel> - </Grid> - </DataTemplate> - </ItemsControl.ItemTemplate> - </ItemsControl> - </ScrollViewer> - </DockPanel> - </Grid> - - <Grid Grid.Row="2"> - <DockPanel> - - <Border DockPanel.Dock="Top" Background="{StaticResource TransparentBackgroundBrush200}" Margin="20 0" Padding="5" CornerRadius="5"> - <Border.Effect> - <DropShadowEffect Opacity="0.4" /> - </Border.Effect> - <Grid> - <TextBlock HorizontalAlignment="Left" Margin="20 0 0 0" FontSize="16">CALIBRATION DATA</TextBlock> - <Button ToolTip="Create excel file template" FontSize="11" Foreground="{StaticResource DarkGrayBrush200}" HorizontalAlignment="Right" Style="{StaticResource MaterialDesignFlatButton}" Height="Auto" VerticalAlignment="Bottom" Padding="0" Command="{Binding CreateCalibrationDataExcelTemplateCommand}" Margin="0 0 5 0"> - <StackPanel Orientation="Horizontal"> - <materialDesign:PackIcon Kind="FileExcel" Foreground="{StaticResource DimGrayBrush}" Width="16" Height="26" /> - <TextBlock VerticalAlignment="Center" Margin="5 0 0 0">Create Empty Excel Template</TextBlock> - </StackPanel> - </Button> - </Grid> - </Border> - - <ScrollViewer x:Name="calibrationDataScrollViewer" ScrollChanged="calibrationDataScrollViewer_ScrollChanged" VerticalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Auto" Margin="15 0 20 0"> - <colorLabViews:CalibrationDataView x:Name="calibrationDataView" Margin="0 10 0 0" DataContext="{Binding CalibrationDataViewVM}" /> - </ScrollViewer> - </DockPanel> - </Grid> - </Grid> - </DockPanel> </Grid> </Grid> </Grid> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml.cs index 2a5d317c6..aa4803bd0 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml.cs @@ -25,32 +25,18 @@ namespace Tango.MachineStudio.RML.Views { private MainViewVM _vm; - public DraggingSurface DraggingSurface - { - get { return (DraggingSurface)GetValue(DraggingSurfaceProperty); } - set { SetValue(DraggingSurfaceProperty, value); } - } - public static readonly DependencyProperty DraggingSurfaceProperty = - DependencyProperty.Register("DraggingSurface", typeof(DraggingSurface), typeof(RmlView), new PropertyMetadata(null)); - - public RmlView() { InitializeComponent(); - DraggingSurface = draggingSurface; Loaded += (_, __) => { _vm = DataContext as MainViewVM; }; } - private void OnProcessTableDropped(object sender, DropEventArgs e) - { - ProcessParametersTable dragged = e.Draggable.DataContext as ProcessParametersTable; - ProcessParametersTable dropped = e.Droppable.DataContext as ProcessParametersTable; - _vm.OnProcessParametersTableDropped(dragged, dropped); - } - private void calibrationDataScrollViewer_ScrollChanged(object sender, ScrollChangedEventArgs e) { - liquidsFactorsScrollViewer.ScrollToHorizontalOffset(e.HorizontalOffset); + if(processParametersView.IsVisible) + { + processParametersView.liquidsFactorsScrollViewer.ScrollToHorizontalOffset(e.HorizontalOffset); + } } } } |
